Notification Escalations


#1

I would like certain services to send SMS/text messages if they are not fixed/acknowledged within a certain timeframe…

[list]]First I added “pager” field to all the relevant contacts, then I added additional contact entries that “use” the original contacts but override the notification methods/commands…
Ie. So all contact details for a person are in a single contact, but then the means of contact can be customised as needed/
:m]
]I then created a hostgroup containing the “mission critical” servers…/:m]
]Created two service and two host escalation rules…/:m]
]Downed one of the HTTP services/:m]
]Observed no escalation after several notifications (watching notification count increase)/:m][/list:u]
What am I missing? I’ve trimmed some detail out of the following config exerpts (to conceal host IDs) and brought the following exerpts together from the several files in which they reside…

[code]define hostgroup{
hostgroup_name missioncritical-hosts
members daserver
}

define host{
host_name daserver
use linux-server
check_interval 1
alias Test entry
address HOSTNAMEFORTESTENTRY
parents PARENTOFHOSTENTRY
notification_interval 1
}

define service{
use generic-service
host_name daserver
service_description HTTP
check_command check_http
notification_interval 1
check_interval 1
}

define hostescalation{
hostgroup_name missioncritical-hosts
contact_groups missioncritical-host-sms-level1
first_notification 2
# last_notification 2 (tried without commenting out also)
}

define hostescalation{
hostgroup_name missioncritical-hosts
contact_groups missioncritical-host-sms-level1,missioncritical-host-sms-level2
first_notification 3
# last_notification 3
}

define serviceescalation{
hostgroup_name missioncritical-hosts
contact_groups missioncritical-service-sms-level1
first_notification 3
# last_notification 3
}

define serviceescalation{
hostgroup_name missioncritical-hosts
contact_groups missioncritical-service-sms-level1,missioncritical-service-sms-level2
first_notification 4
# last_notification 4
}

define contactgroup{
contactgroup_name missioncritical-host-sms-level1
name missioncritical-host-sms-level1
alias Mission Critical SMS Group - Level 1
members ME-sms
}

define contactgroup{
contactgroup_name missioncritical-host-sms-level2
name missioncritical-host-sms-level2
alias Mission Critical SMS Group - Level 2
members SOMEONEELSE-sms,ANOTHERPERSON-sms
}

define contactgroup{
contactgroup_name missioncritical-service-sms-level1
use missioncritical-host-sms-level1
}

define contactgroup{
contactgroup_name missioncritical-service-sms-level2
use missioncritical-host-sms-level2
}

define contact{
contact_name ME
name ME
use generic-contact
alias ME
email MYEMAIL
address1 MYMSN
pager MYMOBILENUMBER
}

define contact{
contact_name ME-sms
use ME
service_notification_commands notify-service-by-sms
host_notification_commands notify-host-by-sms
}

define command{
command_name notify-service-by-sms
command_line /usr/bin/printf “%b” “$CONTACTPAGER$ $NOTIFICATIONTYPE$ for $HOSTNAME$:$SERVICEDESC$ - $SERVICESTATE$ @ $LONGDATETIME$” | /usr/bin/sudo -i -u imuser cim -s msg -p jab -t MYXMPPADDRESS
}

define command{
command_name notify-host-by-sms
command_line /usr/bin/printf “%b” “$CONTACTPAGER$ $NOTIFICATIONTYPE$ for $HOSTNAME$ - $HOSTSTATE$ @ $LONGDATETIME$” | /usr/bin/sudo -i -u imuser cim -s msg -p jab -t MYXMPPADDRESS
}[/code]Now obviously the command doesn’t actually send SMSes at this point - I just wanted to test with XMPP before I went racking up bills :slight_smile: Service Notification[2009-02-17 06:40:40] SERVICE NOTIFICATION: nagiosadmin;daserver;HTTP;CRITICAL;notify-service-by-email;Connection refused Service Notification[2009-02-17 06:40:23] SERVICE NOTIFICATION: nagiosadmin;daserver;HTTP;CRITICAL;notify-service-by-msn;Connection refused Service Notification[2009-02-17 06:38:43] SERVICE NOTIFICATION: nagiosadmin;daserver;HTTP;CRITICAL;notify-service-by-email;Connection refused Service Notification[2009-02-17 06:38:26] SERVICE NOTIFICATION: nagiosadmin;daserver;HTTP;CRITICAL;notify-service-by-msn;Connection refused Service Notification[2009-02-17 06:36:46] SERVICE NOTIFICATION: nagiosadmin;daserver;HTTP;CRITICAL;notify-service-by-email;Connection refused Service Notification[2009-02-17 06:36:29] SERVICE NOTIFICATION: nagiosadmin;daserver;HTTP;CRITICAL;notify-service-by-msn;Connection refused Service Notification[2009-02-17 06:35:39] SERVICE NOTIFICATION: nagiosadmin;daserver;HTTP;CRITICAL;notify-service-by-email;Connection refused Service Notification[2009-02-17 06:35:22] SERVICE NOTIFICATION: nagiosadmin;daserver;HTTP;CRITICAL;notify-service-by-msn;Connection refused Service Notification[2009-02-17 06:33:42] SERVICE NOTIFICATION: nagiosadmin;daserver;HTTP;CRITICAL;notify-service-by-email;Connection refused Service Notification[2009-02-17 06:33:25] SERVICE NOTIFICATION: nagiosadmin;daserver;HTTP;CRITICAL;notify-service-by-msn;Connection refused Service Critical[2009-02-17 06:33:25] SERVICE ALERT: daserver;HTTP;CRITICAL;HARD;3;Connection refused Service Critical[2009-02-17 06:31:25] SERVICE ALERT: daserver;HTTP;CRITICAL;SOFT;2;Connection refused Service Critical[2009-02-17 06:29:25] SERVICE ALERT: daserver;HTTP;CRITICAL;SOFT;1;Connection refused… but the test notify methods are never called…

What am I missing? Incidentally, nagiosadmin is default service contact (also comes to me) and has default notify by MSN and EMAIL methods… Instant messaging is done by “daemonised” copy of CenterIM running under screen as a different user (called through sudo and a shellscript).


#2

Further to this, after some tweaking, I noticed host escalations were working, but not service notifications.

Am I missing something?


#3

Ahhhhhhhhhhh…

I was missing the service description in the serviceescalation definitions (PDF version of documentation doesn’t appear to have the “red” colouring of required directives.

Adding “service_description *” to the escalations made it work as expected…