<!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>woo! I manually applied the changes to checks.c, notifications.c and sehandlers.c to my Nagios 1.1 tarball - and it looks like everything is working as expected (ie: I got one single notification for a WARNING and one single notification for a CRITICAL).</FONT></P>
<P><FONT SIZE=2>Thanks, Ethan.</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: Ethan Galstad [<A HREF="mailto:nagios@nagios.org">mailto:nagios@nagios.org</A>]</FONT>
<BR><FONT SIZE=2>> Sent: Thursday, December 04, 2003 8:55 PM</FONT>
<BR><FONT SIZE=2>> To: 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>> Arghh - looks like this is a bug, as notifications should get reset</FONT>
<BR><FONT SIZE=2>> when a state change occurs. I'll post bug fixes to the 1.x and 2.0</FONT>
<BR><FONT SIZE=2>> (HEAD) branches shortly. Thanks for the note.</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> On 4 Dec 2003 at 19:00, atonns@mail.ivillage.com wrote:</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> > I sent in this post almost a month ago. I'm wondering if anyone</FONT>
<BR><FONT SIZE=2>> > thinks it's a feature worth implementing. I'm not running the latest</FONT>
<BR><FONT SIZE=2>> > HEAD (I'm at v1.1 right now) but I'd be willing to setup a test</FONT>
<BR><FONT SIZE=2>> > instance with the HEAD, make the alterations, etc. - if </FONT>
<BR><FONT SIZE=2>> it's going to</FONT>
<BR><FONT SIZE=2>> > be merged into the codebase. It's pretty hard-core when it comes to</FONT>
<BR><FONT SIZE=2>> > the nitty gritty of the notifications logic. It's taken me some time</FONT>
<BR><FONT SIZE=2>> > just to figure out. -- "Computer science is as much about </FONT>
<BR><FONT SIZE=2>> computers as</FONT>
<BR><FONT SIZE=2>> ></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>> > > -----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 To:</FONT>
<BR><FONT SIZE=2>> > > nagios-devel@lists.sourceforge.net Subject: </FONT>
<BR><FONT SIZE=2>> [Nagios-devel] Different</FONT>
<BR><FONT SIZE=2>> > > 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</FONT>
<BR><FONT SIZE=2>> > > attempt to send a immediate notification (assuming all the other</FONT>
<BR><FONT SIZE=2>> > > checks</FONT>
<BR><FONT SIZE=2>> > 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 notifications.c, but</FONT>
<BR><FONT SIZE=2>> > 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 && svc-</FONT>
<BR><FONT SIZE=2>> > >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 changes</FONT>
<BR><FONT SIZE=2>> > 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 To:</FONT>
<BR><FONT SIZE=2>> > > > nagios-users@lists.sourceforge.net Subject: RE: [Nagios-users]</FONT>
<BR><FONT SIZE=2>> > > > Different paging for 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 can't seem to figure out. Is there a way to</FONT>
<BR><FONT SIZE=2>> > > > > send different types of alerts based on severity. IE: send</FONT>
<BR><FONT SIZE=2>> > > > > warning alerts by e-mail, and critical alerts by </FONT>
<BR><FONT SIZE=2>> pager. The only</FONT>
<BR><FONT SIZE=2>> > > > > way I've seen to do this is to set up two contacts </FONT>
<BR><FONT SIZE=2>> for each user</FONT>
<BR><FONT SIZE=2>> > > > > (bob-email, bob-pager). This seems inordinately </FONT>
<BR><FONT SIZE=2>> clunky, though.</FONT>
<BR><FONT SIZE=2>> > > > > Is 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>> > -</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>> </FONT>
<BR><FONT SIZE=2>> Ethan Galstad,</FONT>
<BR><FONT SIZE=2>> Nagios Developer</FONT>
<BR><FONT SIZE=2>> ---</FONT>
<BR><FONT SIZE=2>> Email: nagios@nagios.org</FONT>
<BR><FONT SIZE=2>> Website: <A HREF="http://www.nagios.org" TARGET="_blank">http://www.nagios.org</A></FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> -------------------------------------------------------</FONT>
<BR><FONT SIZE=2>> This SF.net email is sponsored by: SF.net Giveback Program.</FONT>
<BR><FONT SIZE=2>> Does SourceForge.net help you be more productive? Does it</FONT>
<BR><FONT SIZE=2>> help you create better code? SHARE THE LOVE, and help us help</FONT>
<BR><FONT SIZE=2>> YOU! Click Here: <A HREF="http://sourceforge.net/donate/" TARGET="_blank">http://sourceforge.net/donate/</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>
</P>
</BODY>
</HTML>