Different

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
danjoh
Posts: 73
Joined: Mon Dec 07, 2015 10:43 am
Location: Zürich, Switzerland
Contact:

Different

Post by danjoh »

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?
--
D/\N
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Different

Post by benjaminsmith »

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.
$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.
I haven't tested this, but that might be an option.
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!
danjoh
Posts: 73
Joined: Mon Dec 07, 2015 10:43 am
Location: Zürich, Switzerland
Contact:

Re: Different

Post by danjoh »

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. :oops:
--
D/\N
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Different

Post by cdienger »

Thanks for the update!
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked