All pastes #376326 Raw Edit

Miscellany

public text v1 · immutable
#376326 ·published 2007-02-28 23:37 UTC
rendered paste body
#!/usr/local/bin/perl
#use strict;
use IO::Socket;
use CGI qw/:standard/;



@processes = ("mysqld","sshd","lighttpd","ctorrent");

for ($t=0;$t<=$#processes;$t++) {

        print "Checking $processes[$t]  \n";

        $running = `ps -cax \| grep @processes[$t]`;
        print "$running";

        if ($running =~ /@processes[$t]/) {
                $body="$body\n@processes[$t] -> UP";
        }
        else {
                $body="$body\n@processes[$t] -> DOWN";
        }

}
print "$body";