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.
__________________________
Subscribe now!
The Latest
Newsletter
Tech Tip Videos
- Nov-19-09
- Nov-04-09
Recently Popular
From the Magazine
December 2009, #188
If last month's Infrastrucuture issue was too "big" for you then try on this month's Embedded issue. Find out how to use Player for programming mobile robots, build a humidity controller for your root cellar, find out how to reduce the boot time of your embedded system, and if you're new to embedded systems find out the basics that go into one. You can also read about the Beagle Board, the Mesh Potato and a spate of other interestingly named items. And along with our regular columns don't miss our new monthly column: Economy Size Geek.
Delicious
Digg
StumbleUpon
Reddit
Facebook








You could use Perl's
On November 10th, 2009 Anonymous (not verified) says:
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
On November 10th, 2009 Anonymous (not verified) says:
It removed my <PROC> from the while loop.
while (<PROC>) { chomp; @processes = split(/:/); }I guess its just a case of
On June 3rd, 2008 squantrill says:
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!
Post new comment