<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12">
<TITLE>RE: [Nagios-devel] Forcing hard state change notifications</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2>Hm. Interesting that the "obsess_over_service" option in the service definition documentation has no description (<A HREF="http://nagios.sourceforge.net/docs/1_0/xodtemplate.html#service" TARGET="_blank">http://nagios.sourceforge.net/docs/1_0/xodtemplate.html#service</A>).</FONT></P>
<P><FONT SIZE=2>However, I'm really not 'obsessing' over the service in the nagios sense of the word. I do not want to run an arbitray command everytime a service check is run. I'm just looking to send out notifications upon hard state changes - specifically the change from WARNING to CRITICAL. This was suppressed artificially when I made notification_interval=0 - which should only apply to additional notifications when the hard state is the same non-OK state.</FONT></P>
<P><FONT SIZE=2>Ethan has already commented that this is a bug. I will take a look at the diffs in the Nagios 1.1 CVS to see what direction he's taking on it (hopefully the one I want to go in :)</FONT></P>
<P><FONT SIZE=2>Tony</FONT>
</P>
<P><FONT SIZE=2>--</FONT>
<BR><FONT SIZE=2>"Computer science is as much about computers as</FONT>
<BR><FONT SIZE=2> astronomy is about telescopes" -- Edsger Dijkstra</FONT>
<BR><FONT SIZE=2>---------------------------------------------------------</FONT>
<BR><FONT SIZE=2>Anthony Tonns, UNIX Administrator - atonns@mail.ivillage.com</FONT>
</P>
<BR>
<P><FONT SIZE=2>> -----Original Message-----</FONT>
<BR><FONT SIZE=2>> From: Joe Rhett [<A HREF="mailto:jrhett@isite.net">mailto:jrhett@isite.net</A>]</FONT>
<BR><FONT SIZE=2>> Sent: Friday, December 12, 2003 4:29 AM</FONT>
<BR><FONT SIZE=2>> To: atonns@mail.ivillage.com</FONT>
<BR><FONT SIZE=2>> Cc: nagios-devel@lists.sourceforge.net</FONT>
<BR><FONT SIZE=2>> Subject: Re: [Nagios-devel] Forcing hard state change notifications</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> Out of curiosity (not because I know better) what about the </FONT>
<BR><FONT SIZE=2>> 'obsessing'</FONT>
<BR><FONT SIZE=2>> logic doesn't handle this for you?</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> On Thu, Dec 04, 2003 at 07:00:14PM -0500, </FONT>
<BR><FONT SIZE=2>> atonns@mail.ivillage.com wrote:</FONT>
<BR><FONT SIZE=2>> > I sent in this post almost a month ago. I'm wondering if </FONT>
<BR><FONT SIZE=2>> anyone thinks it's</FONT>
<BR><FONT SIZE=2>> > a feature worth implementing. I'm not running the latest </FONT>
<BR><FONT SIZE=2>> HEAD (I'm at v1.1</FONT>
<BR><FONT SIZE=2>> > right now) but I'd be willing to setup a test instance with </FONT>
<BR><FONT SIZE=2>> the HEAD, make</FONT>
<BR><FONT SIZE=2>> > the alterations, etc. - if it's going to be merged into the </FONT>
<BR><FONT SIZE=2>> codebase.</FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> > It's pretty hard-core when it comes to the nitty gritty of </FONT>
<BR><FONT SIZE=2>> the notifications</FONT>
<BR><FONT SIZE=2>> > logic. It's taken me some time just to figure out.</FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> > --</FONT>
<BR><FONT SIZE=2>> > "Computer science is as much about computers as</FONT>
<BR><FONT SIZE=2>> > astronomy is about telescopes" -- Edsger Dijkstra</FONT>
<BR><FONT SIZE=2>> > ---------------------------------------------------------</FONT>
<BR><FONT SIZE=2>> > Anthony Tonns, UNIX Administrator - atonns@mail.ivillage.com</FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> > > -----Original Message-----</FONT>
<BR><FONT SIZE=2>> > > From: atonns@mail.ivillage.com [<A HREF="mailto:atonns@mail.ivillage.com">mailto:atonns@mail.ivillage.com</A>]</FONT>
<BR><FONT SIZE=2>> > > Sent: Monday, November 10, 2003 6:56 PM</FONT>
<BR><FONT SIZE=2>> > > To: nagios-devel@lists.sourceforge.net</FONT>
<BR><FONT SIZE=2>> > > Subject: [Nagios-devel] Different paging for different levels</FONT>
<BR><FONT SIZE=2>> > ></FONT>
<BR><FONT SIZE=2>> > ></FONT>
<BR><FONT SIZE=2>> > > Below is a post that I made to the nagios-users list over a</FONT>
<BR><FONT SIZE=2>> > > week ago. I</FONT>
<BR><FONT SIZE=2>> > > thought about it, and figured that nagios-devel would be the</FONT>
<BR><FONT SIZE=2>> > > better place</FONT>
<BR><FONT SIZE=2>> > > for it.</FONT>
<BR><FONT SIZE=2>> > ></FONT>
<BR><FONT SIZE=2>> > > Summary: I'm thinking of some global config variable named</FONT>
<BR><FONT SIZE=2>> > > "force_hard_state_change_notification". It would be a</FONT>
<BR><FONT SIZE=2>> > > supplement for people</FONT>
<BR><FONT SIZE=2>> > > that have "notification_interval=0" to suppress periodic</FONT>
<BR><FONT SIZE=2>> > > notifications when</FONT>
<BR><FONT SIZE=2>> > > the hard state is the same not-OK state until recovery, but</FONT>
<BR><FONT SIZE=2>> > > DO want to know</FONT>
<BR><FONT SIZE=2>> > > about other hard state changes while not-OK (ie: a transition</FONT>
<BR><FONT SIZE=2>> > > from WARNING</FONT>
<BR><FONT SIZE=2>> > > to CRITICAL).</FONT>
<BR><FONT SIZE=2>> > ></FONT>
<BR><FONT SIZE=2>> > > --- post follows ---</FONT>
<BR><FONT SIZE=2>> > ></FONT>
<BR><FONT SIZE=2>> > > Whoops. Looks like my assessment was not 100% accurate.</FONT>
<BR><FONT SIZE=2>> > ></FONT>
<BR><FONT SIZE=2>> > > When a service goes from WARNING to CRITICAL it _is_ a hard</FONT>
<BR><FONT SIZE=2>> > > state change.</FONT>
<BR><FONT SIZE=2>> > > The problem is that I have notification_interval=0 - which</FONT>
<BR><FONT SIZE=2>> > > means since it's</FONT>
<BR><FONT SIZE=2>> > > already sent single notification for a non-OK state (the</FONT>
<BR><FONT SIZE=2>> > > WARNING) it will</FONT>
<BR><FONT SIZE=2>> > > not send another notification for ANY OTHER non-OK state (the</FONT>
<BR><FONT SIZE=2>> > > CRITICAL).</FONT>
<BR><FONT SIZE=2>> > ></FONT>
<BR><FONT SIZE=2>> > > What might be the "feature addition" that would make this</FONT>
<BR><FONT SIZE=2>> > > work for me would</FONT>
<BR><FONT SIZE=2>> > > be some option to enable some additional logic so that even if the</FONT>
<BR><FONT SIZE=2>> > > notification_interval=0, Nagios should ignore the time</FONT>
<BR><FONT SIZE=2>> > > interval and attempt</FONT>
<BR><FONT SIZE=2>> > > to send a immediate notification (assuming all the other </FONT>
<BR><FONT SIZE=2>> checks like</FONT>
<BR><FONT SIZE=2>> > > downtime, flapping, etc. pass) whenever there's hard state change.</FONT>
<BR><FONT SIZE=2>> > ></FONT>
<BR><FONT SIZE=2>> > > I'd like to work on adding this feature (I've spent a lot of</FONT>
<BR><FONT SIZE=2>> > > time reading</FONT>
<BR><FONT SIZE=2>> > > the source at this point) but I don't want to add logic where</FONT>
<BR><FONT SIZE=2>> > > it doesn't</FONT>
<BR><FONT SIZE=2>> > > belong. There's a lot of checks going on with</FONT>
<BR><FONT SIZE=2>> > > "check_service_notification_viability" in </FONT>
<BR><FONT SIZE=2>> notifications.c, but there's</FONT>
<BR><FONT SIZE=2>> > > nothing about how to determine a hard state change. That's</FONT>
<BR><FONT SIZE=2>> > > done in checks.c</FONT>
<BR><FONT SIZE=2>> > > as part of "reap_service_checks". The "semi-psuedo code" for</FONT>
<BR><FONT SIZE=2>> > > my suggested</FONT>
<BR><FONT SIZE=2>> > > change to "check_service_notification_viability" would be:</FONT>
<BR><FONT SIZE=2>> > ></FONT>
<BR><FONT SIZE=2>> > > /* dont notify contacts about this service problem again if</FONT>
<BR><FONT SIZE=2>> > > the notification</FONT>
<BR><FONT SIZE=2>> > > interval is set to 0</FONT>
<BR><FONT SIZE=2>> > > * unless forcing notification due to a hard state change */</FONT>
<BR><FONT SIZE=2>> > > if(svc->current_state!=STATE_OK && </FONT>
<BR><FONT SIZE=2>> svc->no_more_notifications==TRUE){</FONT>
<BR><FONT SIZE=2>> > > if(force_hard_state_change_notification == FALSE ||</FONT>
<BR><FONT SIZE=2>> > > (svc->current_state!=svc->last_state &&</FONT>
<BR><FONT SIZE=2>> > > svc->current_attempt>=svc->max_attempts)) {</FONT>
<BR><FONT SIZE=2>> > > #ifdef DEBUG4</FONT>
<BR><FONT SIZE=2>> > > printf("\tWe shouldn't re-notify contacts</FONT>
<BR><FONT SIZE=2>> > > about this service</FONT>
<BR><FONT SIZE=2>> > > problem!\n");</FONT>
<BR><FONT SIZE=2>> > > #endif</FONT>
<BR><FONT SIZE=2>> > > return ERROR;</FONT>
<BR><FONT SIZE=2>> > > }</FONT>
<BR><FONT SIZE=2>> > > #ifdef DEBUG4</FONT>
<BR><FONT SIZE=2>> > > else {</FONT>
<BR><FONT SIZE=2>> > > printf("\tNotifications about hard state </FONT>
<BR><FONT SIZE=2>> changes were</FONT>
<BR><FONT SIZE=2>> > > forced!\n"0;</FONT>
<BR><FONT SIZE=2>> > > }</FONT>
<BR><FONT SIZE=2>> > > #endif</FONT>
<BR><FONT SIZE=2>> > > }</FONT>
<BR><FONT SIZE=2>> > ></FONT>
<BR><FONT SIZE=2>> > > --</FONT>
<BR><FONT SIZE=2>> > > "Computer science is as much about computers as</FONT>
<BR><FONT SIZE=2>> > > astronomy is about telescopes" -- Edsger Dijkstra</FONT>
<BR><FONT SIZE=2>> > > ---------------------------------------------------------</FONT>
<BR><FONT SIZE=2>> > > Anthony Tonns, UNIX Administrator - atonns@mail.ivillage.com</FONT>
<BR><FONT SIZE=2>> > ></FONT>
<BR><FONT SIZE=2>> > ></FONT>
<BR><FONT SIZE=2>> > > > -----Original Message-----</FONT>
<BR><FONT SIZE=2>> > > > From: atonns@mail.ivillage.com [<A HREF="mailto:atonns@mail.ivillage.com">mailto:atonns@mail.ivillage.com</A>]</FONT>
<BR><FONT SIZE=2>> > > > Sent: Friday, October 24, 2003 12:22 PM</FONT>
<BR><FONT SIZE=2>> > > > To: nagios-users@lists.sourceforge.net</FONT>
<BR><FONT SIZE=2>> > > > Subject: RE: [Nagios-users] Different paging for </FONT>
<BR><FONT SIZE=2>> different levels</FONT>
<BR><FONT SIZE=2>> > > ></FONT>
<BR><FONT SIZE=2>> > > ></FONT>
<BR><FONT SIZE=2>> > > > Matter of factly, your situation doesn't even work properly.</FONT>
<BR><FONT SIZE=2>> > > ></FONT>
<BR><FONT SIZE=2>> > > > ie:</FONT>
<BR><FONT SIZE=2>> > > > If a service goes from OK to WARNING this is a hard state</FONT>
<BR><FONT SIZE=2>> > > > change, and it</FONT>
<BR><FONT SIZE=2>> > > > will notify via email.</FONT>
<BR><FONT SIZE=2>> > > > If it then goes from WARNING to CRITICAL this is NOT a hard</FONT>
<BR><FONT SIZE=2>> > > > state change and</FONT>
<BR><FONT SIZE=2>> > > > it will NOT notify via pager.</FONT>
<BR><FONT SIZE=2>> > > ></FONT>
<BR><FONT SIZE=2>> > > > I have not found a solution for this problem. However, I</FONT>
<BR><FONT SIZE=2>> > > > would really like</FONT>
<BR><FONT SIZE=2>> > > > to be able to handle sending notification via pager when a</FONT>
<BR><FONT SIZE=2>> > > > service enters a</FONT>
<BR><FONT SIZE=2>> > > > CRITICAL state without adding an ocsp_command.</FONT>
<BR><FONT SIZE=2>> > > ></FONT>
<BR><FONT SIZE=2>> > > > --</FONT>
<BR><FONT SIZE=2>> > > > "Computer science is as much about computers as</FONT>
<BR><FONT SIZE=2>> > > > astronomy is about telescopes" -- Edsger Dijkstra</FONT>
<BR><FONT SIZE=2>> > > > ---------------------------------------------------------</FONT>
<BR><FONT SIZE=2>> > > > Anthony Tonns, UNIX Administrator - atonns@mail.ivillage.com</FONT>
<BR><FONT SIZE=2>> > > ></FONT>
<BR><FONT SIZE=2>> > > ></FONT>
<BR><FONT SIZE=2>> > > > > -----Original Message-----</FONT>
<BR><FONT SIZE=2>> > > > > From: Chris Gill [<A HREF="mailto:cgill@NewWorldApps.com">mailto:cgill@NewWorldApps.com</A>]</FONT>
<BR><FONT SIZE=2>> > > > > Sent: Thursday, October 23, 2003 11:32 AM</FONT>
<BR><FONT SIZE=2>> > > > > To: 'nagios-users@lists.sourceforge.net'</FONT>
<BR><FONT SIZE=2>> > > > > Subject: [Nagios-users] Different paging for different levels</FONT>
<BR><FONT SIZE=2>> > > > ></FONT>
<BR><FONT SIZE=2>> > > > ></FONT>
<BR><FONT SIZE=2>> > > > > Hi all,</FONT>
<BR><FONT SIZE=2>> > > > > We've moved to Nagios here over the last few months,</FONT>
<BR><FONT SIZE=2>> > > > > and things have</FONT>
<BR><FONT SIZE=2>> > > > > been going swimingly. There's one question, though, that's</FONT>
<BR><FONT SIZE=2>> > > > > cropped up that I</FONT>
<BR><FONT SIZE=2>> > > > > can't seem to figure out. Is there a way to send different</FONT>
<BR><FONT SIZE=2>> > > > > types of alerts</FONT>
<BR><FONT SIZE=2>> > > > > based on severity. IE: send warning alerts by e-mail, and</FONT>
<BR><FONT SIZE=2>> > > > > critical alerts by</FONT>
<BR><FONT SIZE=2>> > > > > pager. The only way I've seen to do this is to set up two</FONT>
<BR><FONT SIZE=2>> > > > > contacts for each</FONT>
<BR><FONT SIZE=2>> > > > > user (bob-email, bob-pager). This seems inordinately clunky,</FONT>
<BR><FONT SIZE=2>> > > > > though. Is</FONT>
<BR><FONT SIZE=2>> > > > > there a better way to do it?</FONT>
<BR><FONT SIZE=2>> > > > ></FONT>
<BR><FONT SIZE=2>> > > > > </FONT>
<BR><FONT SIZE=2>> -----------------------------------------------------------------</FONT>
<BR><FONT SIZE=2>> > > > > Christopher P. Gill, Systems Engineer, New World Apps</FONT>
<BR><FONT SIZE=2>> > > > > cgill@newworldapps.com</FONT>
<BR><FONT SIZE=2>> > > > > 703-856-7268 (Cell/Business)</FONT>
<BR><FONT SIZE=2>> > ></FONT>
<BR><FONT SIZE=2>> > > --</FONT>
<BR><FONT SIZE=2>> > > "Computer science is as much about computers as</FONT>
<BR><FONT SIZE=2>> > > astronomy is about telescopes" -- Edsger Dijkstra</FONT>
<BR><FONT SIZE=2>> > > ---------------------------------------------------------</FONT>
<BR><FONT SIZE=2>> > > Anthony Tonns, UNIX Administrator - atonns@mail.ivillage.com</FONT>
<BR><FONT SIZE=2>> > ></FONT>
<BR><FONT SIZE=2>> > ></FONT>
<BR><FONT SIZE=2>> > > -------------------------------------------------------</FONT>
<BR><FONT SIZE=2>> > > This SF.Net email sponsored by: ApacheCon 2003,</FONT>
<BR><FONT SIZE=2>> > > 16-19 November in Las Vegas. Learn firsthand the latest</FONT>
<BR><FONT SIZE=2>> > > developments in Apache, PHP, Perl, XML, Java, MySQL,</FONT>
<BR><FONT SIZE=2>> > > WebDAV, and more! <A HREF="http://www.apachecon.com/" TARGET="_blank">http://www.apachecon.com/</A></FONT>
<BR><FONT SIZE=2>> > > _______________________________________________</FONT>
<BR><FONT SIZE=2>> > > Nagios-devel mailing list</FONT>
<BR><FONT SIZE=2>> > > Nagios-devel@lists.sourceforge.net</FONT>
<BR><FONT SIZE=2>> > > <A HREF="https://lists.sourceforge.net/lists/listinfo/nagios-devel" TARGET="_blank">https://lists.sourceforge.net/lists/listinfo/nagios-devel</A></FONT>
<BR><FONT SIZE=2>> > ></FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> --</FONT>
<BR><FONT SIZE=2>> Joe Rhett </FONT>
<BR><FONT SIZE=2>> Chief Geek</FONT>
<BR><FONT SIZE=2>> JRhett@Isite.Net Isite </FONT>
<BR><FONT SIZE=2>> Services, Inc.</FONT>
<BR><FONT SIZE=2>> </FONT>
</P>
</BODY>
</HTML>