Page 1 of 1

%alertsummary% empty when sending a custom notification?

Posted: Tue Sep 17, 2013 3:22 pm
by eclypse
I've noticed that when I send a custom notification, the %alertsummary% line is empty, and therefore the comment that I entered is not displayed to users receiving the notification email.

I would expect to see something like:

Code: Select all

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

This custom notification was sent by tonythetiger with a comment of 'Everything's Grrrreat'.

Notification Type: CUSTOM

Service: check_cereal_port
Instead, the output looks like this:

Code: Select all

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



Notification Type: CUSTOM

Service: check_cereal_port
Now, obviously I could change my notification settings and service notification handler to include a separate reference to the %comments% variable, but I was wondering if this is a bug or oversight in how %alertsummary% is composed and included into the default notification email template.

Re: %alertsummary% empty when sending a custom notification?

Posted: Tue Sep 17, 2013 3:37 pm
by sreinhardt
Can you post the actual notification as listed for that user please.

Re: %alertsummary% empty when sending a custom notification?

Posted: Tue Sep 17, 2013 7:52 pm
by eclypse
If I understand your question correctly, this is the email message format for this user (and all other users as we use the same for everyone)

Service Alert Subject:

Code: Select all

%type% Service Alert - %host%/%service% is %servicestate%
Service Alert Message:

Code: Select all

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

%alertsummary%

Notification Type: %type%

Service: %service%
Host: %host%
Description: %hostalias%
Address: %hostaddress%
State: %servicestate%
Info: %serviceoutput%
Details: %longserviceoutput%
Date/Time: %datetime%

Respond: %responseurl%
Nagios URL: %xiserverurl%

Re: %alertsummary% empty when sending a custom notification?

Posted: Wed Sep 18, 2013 9:51 am
by abrist
You will need to add the %comments% macro to your notifications. There were some changes to the message format with the XI notification handlers. The comments are not sent by default, and the custom notification function was originally designed for core and the core handlers (which do include comments as default). Just include the macro for host and services and all should be well.