Page 1 of 1

Email Notifications - Duration Macros Not Working in Emails

Posted: Wed Jan 22, 2020 6:51 pm
by scomdco
I've configured our email notifications to also include the durations of the particular check, whether that's a host or a service, but either the macro is not being recognized, there's no value to give, or something else is the issue. Any assistance would be much appreciated,

I'm not sure if all macros from this page are supposed to work for the email notifications, i DID get the hostalias macro to successfully give output in the email after finding it in this list,

Let me know if i'm deciphering the column incorrectly, but it says they should work for notifications
https://assets.nagios.com/downloads/nag ... stduration
host.png
service.png
Here's how i have the email config,
emailconfig.png
i've reached the max for attachments, but here's the output i get in the email as text (disregard the issue that the alert is informing of):

Code: Select all

---- Respond above this line ----

***** Nagios XI Alert *****

Nagios has detected a problem with this service.

Notification Type: PROBLEM

Service: SQL Server
Host: REDACTED
Host Alias: REDACTED (this works)
Address: REDACTED
State: UNKNOWN
Info: UNKNOWN - The WMI query had problems. The error text from wmic is: [wmi/wmic.c:212:main()] ERROR: Retrieve result data.
Date/Time: 2020-01-22 15:48:25
Status Duration: %serviceduration%

Respond: REDACTED
Nagios URL: REDACTED

-----

To reply, keep the following data in your response email.

##REDACTED

Re: Email Notifications - Duration Macros Not Working in Ema

Posted: Wed Jan 22, 2020 8:22 pm
by Box293
I don't believe those macros are in the default notification command but can be added, please refer to the following documentation:

https://assets.nagios.com/downloads/nag ... iables.pdf