Enabled 1 Name "ldapd -p 389" Message "LDAP is not running" Level medium Name "sendmail: accepting" Message "Sendmail daemon is not accepting connections" Level critical Name /xntpd Message "NTP daemon is not running" Level minor Name apache/bin/httpd Message "Apache web server is not running" Level minor #### #!/usr/bin/perl -w use strict; use Config::General; delete @ENV{qw(IFS PATH CDPATH ENV BASH_ENV)}; my %config = Config::General->new( -ConfigFile => ".processcheckrc", -LowerCaseNames => 1, )->getall; exit unless $config{enabled}; my $ptable = `/usr/bin/ps xo command`; my %alert; while(my($name,$option) = each %{$config{process}}) { my $re = quotemeta $option->{name}; push @{ $alert{ $option->{level} } }, $option->{message} unless $ptable =~ /$re/; } print "REPORT TAKEN AT " . localtime . "\n"; print map "$_\n", "\U$_\E ALERTS", @{%alert{$_}} for sort keys %alert;