Loading
Checkup Routine for Linux Server
Hello.
My manager asked me to create a daily / weekly / monthly checkup routine for a linux server (Centos 4). Some kind of a "to do" list, making sure all of the relevant services are working properly: hardware, software, network services, quota... I'm a linux newbie, and am not aware of all the components that are relevant to this kind of checkup.
Can you help me?
Thank you.
Trending Topics
| You Need A Budget | Feb 10, 2012 |
| The Linux powered LAN Gaming House | Feb 08, 2012 |
| Creating a vDSO: the Colonel's Other Chicken | Feb 06, 2012 |
| Your CMS Is Not Your Web Site | Feb 01, 2012 |
| Casper, the Friendly (and Persistent) Ghost | Jan 31, 2012 |
| Razor-qt 0.4 - Qt based Desktop Environment | Jan 30, 2012 |
- Fun with ethtool
- Parallel Programming with NVIDIA CUDA
- Readers' Choice Awards 2011
- 100% disappointed with the decision to go all digital.
- Linux-Based X Terminals with XDMCP
- Validate an E-Mail Address with PHP, the Right Way
- You Need A Budget
- The Linux powered LAN Gaming House
- Why Python?
- Python for Android
- Employment Posters
3 hours 4 min ago - Sure the best distro is
4 hours 24 min ago - BeOS was the best
7 hours 8 min ago - I use Wireshark on a daily
11 hours 38 min ago - buena información
16 hours 45 min ago - One important "bucket" that I didn't note (désolé si qqun deja d
17 hours 46 min ago - Gnome3 is such a POS. No one
1 day 3 hours ago - Gnome 3 is the biggest POS
1 day 3 hours ago - I didn't knew this thing by
1 day 9 hours ago - Author's reply
1 day 12 hours ago





You could use Perl's
You could use Perl's Proc::ProcessTable module.
Personally I'd create a text file with the services I was checking for, seperated by a colon like:
apache2:sshd:mysqld
Then I'd read that into the script and match it to the running processes using Proc::ProcessTable.
http://search.cpan.org/~durist/Proc-ProcessTable-0.45/Process/Process.pm should be able to get you started. Here's an ugly code that I threw together. It'll get the job done but there's much better ways to do it:
#!/usr/bin/perl use strict; use warnings; use Proc::ProcessTable; use Data::Dumper; my $table = new Proc::ProcessTable( 'cache_ttys' => 1); my @processes; open(PROC, 'proc.check'); while () { chomp; @processes = split(/:/); } close(PROC); foreach my $process (@{$table->table}) { foreach my $monitor ($process->{cmndline}) { foreach my $check (@processes) { if ($monitor =~ m/$check/i) { print "$check found running\n"; } else { next; } } } }Output will be:
It removed my <PROC> from
It removed my <PROC> from the while loop.
while (<PROC>) { chomp; @processes = split(/:/); }I guess its just a case of
I guess its just a case of checking services are running I wrote a check script for a tru64 system once but seem to have lost it but its really write down all the services you think should be running then check them
i.e
ps -ef | grep http
telnet localhost 80
this is a basic check for a running apache server but there is much more you can do of course.. Really is such a wide requirements question you need to be a bit more specific in your question!