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