Is it possible to have a different "host_notification_commands/service_notification_commands" for escalations?
Example:
We have two users (say "dan" & "ken"), both are setup with host- and service-notification commands (notify-host-by-email/notify-service-by-email).
"dan" is primary contact for "host1" (this host has no escalation configuration).
"ken" is the primary contact for "host2" and "dan" receives escalations from this host.
What I want to do is to use different host- and service-notification commands when escalating host2 to "dan" compared with the normal notifications for host1.
Any suggestions?
Different
Different
--
D/\N
D/\N
-
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: Different
Hi @danjoh,
That's a good question. This isn't an out-of-the-box feature in Nagios Core, but you might be able to create a wrapper script for the notification command on this host that will check if the notification is escalated or check to see who is being notified and call the different notification command.
There is a Standard Macro available in Nagios Core that will indicate if it's escalated or not and the recipient of the notification.
That's a good question. This isn't an out-of-the-box feature in Nagios Core, but you might be able to create a wrapper script for the notification command on this host that will check if the notification is escalated or check to see who is being notified and call the different notification command.
There is a Standard Macro available in Nagios Core that will indicate if it's escalated or not and the recipient of the notification.
I haven't tested this, but that might be an option.$NOTIFICATIONISESCALATED$ An integer indicating whether this was sent to normal contacts for the host or service or if it was escalated. 0 = Normal (non-escalated) notification , 1 = Escalated notification.
$NOTIFICATIONRECIPIENTS$ A comma-separated list of the short names of all contacts that are being notified about the host or service.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Different
Thanks for the feedback.
I will look into using $NOTIFICATIONISESCALATED$ in my notification script (I already have a script for sending notifications in HTML format). This should not be that hard to extend.
By the way, sorry for the short title - pressed "Submit" a bit to fast.
I will look into using $NOTIFICATIONISESCALATED$ in my notification script (I already have a script for sending notifications in HTML format). This should not be that hard to extend.
By the way, sorry for the short title - pressed "Submit" a bit to fast.
--
D/\N
D/\N
Re: Different
Thanks for the update!
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.