%alertsummary% empty when sending a custom notification?

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
eclypse
Posts: 50
Joined: Thu Dec 01, 2011 4:55 pm

%alertsummary% empty when sending a custom notification?

Post 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.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

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

Post by sreinhardt »

Can you post the actual notification as listed for that user please.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
eclypse
Posts: 50
Joined: Thu Dec 01, 2011 4:55 pm

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

Post 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%
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

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

Post 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.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked