Determine previous service state in notification script

Jonathan Thorpe jthorpe at Conexim.com.au
Mon Aug 1 01:34:29 CEST 2011


Hi All,

I run a Nagios 2.6 installation and have a custom notification script for sending out SMSes.

A common complaint I have from people on-call is the fact they receive warnings for servers that reach warning level for storage.

What I'd like to do is customise my notification script so that it only sends storage warnings (and their accompanying recoveries) as SMSes during business hours only.

Effectively, I'd like it to do the following (only for services of type "STORAGE"):

OK -> WARNING: No Alert
WARNING -> OK: No Alert

WARNING -> CRITICAL: Alert
CRITICAL -> WARNING: Alert

OK -> CRITICAL: Alert
CRITICAL -> OK: Alert

I have no problem implementing this functionality, provided I can work out what the previous state is. Is there a way through the Nagios API that would allow me to query what the previous state was before the current level, or would I be better off tracking this through the notification script?

Thanks,
Jonathan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20110731/f935bfe1/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
Got Input?   Slashdot Needs You.
Take our quick survey online.  Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
-------------- next part --------------
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null


More information about the Users mailing list