<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/1.0.2">
</HEAD>
<BODY>
Scott,
<BR>

<BR>
Do you have any informations or how is this feature configured, I mean the fact that when nagios die someone is notified ?
<BR>
Concerning the GSM modem, I'm investigating in how this can be done.
<BR>
NOTE that we are in french country, and actually I have no idea on HOW this can be performed.
<BR>

<BR>
Thanks for your help.
<BR>

<BR>
Le sam 16/11/2002 à 16:47, Scott a écrit :
    <BLOCKQUOTE>
<PRE><FONT COLOR="#737373"><FONT SIZE="3"><I>Okay, I see where this is heading.. basically, as I think I was discussing</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>this with somebody else on this list, have a GSM modem attached to the</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>server directly. When nagios dies it sends a page to a designated</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>person(s).. This is not part of Nagios itelf for obvious reasons in that</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>it cant monitor if it is not alive to monitor...</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>The downfall of this is that the contacts have to be hard coded outside</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>nagios (unless somebody wants to write a parser for the contacts.cfg) but</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>this isnt really a problem unless you have a quick turnover of</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>staff/sysadmins. :)</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>Pascal Miquet said:</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> This is OK I presume,</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> But how should I take care of nagios notification, if I set  a service</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> into nagios, and like to notify persons in charge of this service ? Into</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> the script we just checks the nagios running state.</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> Any idea ?</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> Le sam 16/11/2002 Ã  10:30, Scott a Ã©crit :</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     Just to make an appendment to this, I noticed I had it in a test</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> state while writing it... here is the actual working copy.. sorry</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> about that folks.. enjoy</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     #!/usr/bin/perl</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     open PIDFILE, ("/path/to/nagios/var/nagios.lock");</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     $pid = <PIDFILE>;</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     close PIDFILE;</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     @nag_stat = `ps -ax |grep -e $pid`;</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     if (@nag_stat[0]) {</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>             print "nagios running\n";</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     } else {</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>             system('printf "Nagios not running: replace this with</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> external</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     command\n"');</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     }</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     Scott said:</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     > I think you could just check the pid file for a number and run it</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> against a ps -ax greping the pid, then notify if it doesnt exist..</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> sounds fairly simple and probably a good idea too... Nothing worse</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> then a network outage to find out that nagios isnt monitoring the</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> network anyway...</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     ></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     > #!/usr/bin/perl</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     ></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     > open PIDFILE, ("/path/to/nagios/var/nagios.lock");</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     > $pid = <PIDFILE>;</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     > close PIDFILE;</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     ></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     > @nag_stat = `ps -ax |grep -e $pid`;</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     ></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     > if (!@nag_stat[0]) {</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     >         print "nagios running\n";</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     > } else {</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     >         system('printf "Nagios not running: replace this with</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> external</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     > command\n</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     > "');</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     > }</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     ></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     > Somthing like this from cron would work nicely for that.. crude,</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> yes, works, yes also.. somebody probably has better perl skills</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> than myself that could ake this better but it would do what you</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> are asking for though.</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     ></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     ></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     > Pascal Miquet said:</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     >> Is there some stuff to check that nagios is still alive, and may</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> be send an email.</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     >> Doing this is tricky with nagios, I know.</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     >> But I wonder, how admins could be informed that nagios is in a</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> blocking state or is not active.</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     >> Personaly, I think that a shell schedule by the anacron in an</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> hourly mode shoud be a good way, and then send Email and sms.</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     >></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     >> But the semantic question is how could we fetch the nagios</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> settings to issue notifications ?</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     >></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     >> Any good idea, or link is welcome.</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     >> Pascal Miquet</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     ></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     ></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     ></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     ></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     ></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     > -------------------------------------------------------</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     > This sf.net email is sponsored by: To learn the basics of securing</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>  your web site with SSL, click here to get a FREE TRIAL of a</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> Thawte  Server Certificate: http://www.gothawte.com/rd524.html</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     > _______________________________________________</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     > Nagios-users mailing list</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     > Nagios-users@lists.sourceforge.net</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     > https://lists.sourceforge.net/lists/listinfo/nagios-users</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     -------------------------------------------------------</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     This sf.net email is sponsored by: To learn the basics of securing</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> your web site with SSL, click here to get a FREE TRIAL of a Thawte</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> Server Certificate: http://www.gothawte.com/rd524.html</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     _______________________________________________</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     Nagios-users mailing list</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>>     Nagios-users@lists.sourceforge.net</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> https://lists.sourceforge.net/lists/listinfo/nagios-users</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I></FONT></FONT></I>
</PRE>
    </BLOCKQUOTE>
</BODY>
</HTML>