How to have an escalation just respond to criticals and recoveries from criticals only (not warnings)
Max
perldork at webwizarddesign.com
Sat Jul 11 05:38:36 CEST 2009
Hi,
Nagios 3.0.3.
Our configurations are set up so that notifications go out for every
state, but we have escalations that we want to only go out if they are
for a critical alert or a recovery from a critical. the problem we
are having is that by doing an escalation like this:
define serviceescalation {
name nagios-hosts-base-svc
hostgroup_name nagios_hosts
contact_groups admins
first_notification 1 ; notify right away (1st notification)
last_notification 0 ; notify until service changes state
notification_interval 240 ; default to 4 hour re-notify
escalation_period 24x7
register 0
}
define serviceescalation {
use nagios-hosts-base-svc
service_description .*
escalation_options c,r
}
We get criticals and we get recoveries from warning states too. I
looked at the code as I had thought that a recovery was only sent out
if the escalation had been triggered for a non-OK state listed in
escalation options, and saw that I was wrong :p
if(svc->current_state==STATE_OK && se->escalate_on_recovery==FALSE)
return FALSE;
else if(svc->current_state==STATE_WARNING && se->escalate_on_warning==FA
LSE)
return FALSE;
else if(svc->current_state==STATE_UNKNOWN && se->escalate_on_unknown==FA
LSE)
return FALSE;
else if(svc->current_state==STATE_CRITICAL && se->escalate_on_critical==
FALSE)
return FALSE;
return TRUE;
}
So since we only do recovery notifications when we list non-ok states,
we could hack the code and add a conditional to only escalate on
recovery if an escalation was sent out for a non-ok state for the same
service (not sure how to do add that code at this point though :p).
Anyone else encounter this and know how to do that association (only
send out recovery escalation if a non-ok escalation was sent out for
the escalation listing 'r' as a state) without an external script or
code change?
Thanks
Max
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
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