Kickstart has asked for the wisdom of the Perl Monks concerning the following question:
I'm open to other ways to make this check happen for each of the daemons if anyone has any ideas.
Thanks!
my @loc_daemons = qw( crond winbindd smbd nmbd cups sshd zappa ); sub check_daemons { my ($process, $allcool, $psaxline); my @psax_list = `ps ax`; foreach $process (@loc_daemons) { chomp $process; # Just in case $allcool = 'true'; foreach $psaxline (@psax_list) { if ($psaxline =~ "$process") { $allcool = 'true' unless ($allcool eq +'false'); } else { $allcool = 'false'; } } if ($allcool eq 'false') { $output .= "$process does not appear to be run +ning!\n"; $hellbrokeloose = 'true'; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Checking a running daemon
by Kanji (Parson) on Oct 22, 2002 at 22:56 UTC | |
|
Re: Checking a running daemon
by BrowserUk (Patriarch) on Oct 22, 2002 at 22:50 UTC | |
|
Re: Checking a running daemon
by kvale (Monsignor) on Oct 22, 2002 at 22:55 UTC | |
|
Re: Checking a running daemon
by graff (Chancellor) on Oct 23, 2002 at 00:53 UTC |