Page 1 of 2

ID's for problem and recovery notifications

Posted: Wed Aug 29, 2018 1:57 am
by salok
Hi,

We are currently building scenario where Nagios email alerts will be read to MS Dynamics 365 from mailbox. Then processed in D365 as events or cases.

Question is how we can find identifier for problem and recovery type notifications for single Nagios alert? So that custom parser in D365 could detect from the recovery email which host or service problem this recovery notification is for. The ID's (event ID, Problem ID) what we have been testing are running numbers, so recovery notification has different ID than original problem notification.

What would be your recommendation for this scenario?

Br
Kristian

Re: ID's for problem and recovery notifications

Posted: Wed Aug 29, 2018 12:45 pm
by cdienger
$LASTHOSTPROBLEMID$ and $LASTSERVICEPROBLEMID$ can be used to identify previous problems. See https://assets.nagios.com/downloads/nag ... olist.html for descriptions of these.

Re: ID's for problem and recovery notifications

Posted: Thu Aug 30, 2018 8:44 am
by salok
Thank you, we'll test with these ones.

Re: ID's for problem and recovery notifications

Posted: Thu Aug 30, 2018 11:30 am
by cdienger
Sounds good. Please update the thread once you've been able to test :)

Re: ID's for problem and recovery notifications

Posted: Mon Oct 01, 2018 7:32 am
by salok
cdienger wrote:$LASTHOSTPROBLEMID$ and $LASTSERVICEPROBLEMID$ can be used to identify previous problems. See https://assets.nagios.com/downloads/nag ... olist.html for descriptions of these.
Hi, dummy question but where actually these macros should be added to get last (host or service) problem ID written to recovery type emails?

Re: ID's for problem and recovery notifications

Posted: Mon Oct 01, 2018 12:29 pm
by cdienger
You'll need to modify the notification commands before you can include the variables in notification emails. https://assets.nagios.com/downloads/nag ... iables.pdf covers this.

Re: ID's for problem and recovery notifications

Posted: Thu Oct 11, 2018 6:30 am
by salok
Thanks got the macros working.

However there is one question regarding. I've created a copies from original event handlers then modified those. Then modified the contact to use those copied event handlers, after I do this I cannot anymore modify that specific contact's notification messages. I get this: Nagios XI notification handlers are not defined for this account.XI notification handlers must be defined in the Core Config Manager for customized notification settings.

Even this message is there the notifications do work and contains data as expected. Any ideas?

Re: ID's for problem and recovery notifications

Posted: Thu Oct 11, 2018 4:28 pm
by ssax
The code only checks if the commands match xi_host_notification_handler and xi_service_notification_handler. Because the command names are different it won't show you that because it assumes you are using a custom handler that doesn't support the stuff the XI default notification handlers do.

Re: ID's for problem and recovery notifications

Posted: Thu Oct 11, 2018 4:31 pm
by ssax
As a workaround you could change the notification commands back to the XI defaults, modify the messages, and then change the notification commands since you have verified that it does still pick up the changes.

Re: ID's for problem and recovery notifications

Posted: Tue Oct 23, 2018 4:27 am
by salok
Ok, thanks for the explanation.