Survey of Nagios.

Scott lists.scott at themagicbox.net
Sat Nov 16 10:30:20 CET 2002


Just to make an appendment to this, I noticed I had it in a test state
while writing it... here is the actual working copy.. sorry about that
folks.. enjoy

#!/usr/bin/perl

open PIDFILE, ("/path/to/nagios/var/nagios.lock");
$pid = <PIDFILE>;
close PIDFILE;
@nag_stat = `ps -ax |grep -e $pid`;

if (@nag_stat[0]) {
        print "nagios running\n";
} else {
        system('printf "Nagios not running: replace this with external
command\n"');
}

Scott said:
> I think you could just check the pid file for a number and run it
> against a ps -ax greping the pid, then notify if it doesnt exist..
> sounds fairly simple and probably a good idea too... Nothing worse then
> a network outage to find out that nagios isnt monitoring the network
> anyway...
>
> #!/usr/bin/perl
>
> open PIDFILE, ("/path/to/nagios/var/nagios.lock");
> $pid = <PIDFILE>;
> close PIDFILE;
>
> @nag_stat = `ps -ax |grep -e $pid`;
>
> if (!@nag_stat[0]) {
>         print "nagios running\n";
> } else {
>         system('printf "Nagios not running: replace this with external
> command\n
> "');
> }
>
> Somthing like this from cron would work nicely for that.. crude, yes,
> works, yes also.. somebody probably has better perl skills than myself
> that could ake this better but it would do what you are asking for
> though.
>
>
> Pascal Miquet said:
>> Is there some stuff to check that nagios is still alive, and may be
>> send an email.
>> Doing this is tricky with nagios, I know.
>> But I wonder, how admins could be informed that nagios is in a
>> blocking state or is not active.
>> Personaly, I think that a shell schedule by the anacron in an  hourly
>> mode shoud be a good way, and then send Email and sms.
>>
>> But the semantic question is how could we fetch the nagios settings to
>> issue notifications ?
>>
>> Any good idea, or link is welcome.
>> Pascal Miquet
>
>
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by: To learn the basics of securing  your
> web site with SSL, click here to get a FREE TRIAL of a Thawte  Server
> Certificate: http://www.gothawte.com/rd524.html
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users





-------------------------------------------------------
This sf.net email is sponsored by: To learn the basics of securing 
your web site with SSL, click here to get a FREE TRIAL of a Thawte 
Server Certificate: http://www.gothawte.com/rd524.html




More information about the Users mailing list