Page 1 of 1

Email Notifications Different for Contact Templates

Posted: Mon Aug 03, 2015 10:53 am
by jkinning
Is there a different place I need to modify the email notificaiton message at? I currently under Admin->Notification Managment have the following:

Code: Select all

Host Alert Subject:%type% Host Alert - %host% is %hoststate%

Host Alert Message:<style type='text/css'>.UP {color:green;}.DOWN {color:red;}.UNREACHABLE {color:orange}</style>
<h2 class='%hoststate%'>***** Nagios XI Alert *****</h2>

%alertsummary%

Notification Type: %type%
Host: %host%
State: <strong class='%hoststate%'>%hoststate%</strong>
Address: %hostaddress%
Info: %hostoutput%
Date/Time: %datetime%

Respond: <href a="%responseurl%">%responseurl%</a>
Nagios URL: %xiserverurl%

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

Service Alert Message:<style type='text/css'>.OK {color:green;}.WARNING {color:blue;}.UNKNOWN {color:orange}.CRITICAL {color:red}</style>
<h2 class='%servicestate%'>***** Nagios XI Alert *****</h2>

%alertsummary%

Notification Type: %type%
Service Name: %service%
State: <strong class='%servicestate%'>%servicestate%</strong>
Host Name: %host%
Hostalias: %hostalias%
Address: %hostaddress%

Info:
%serviceoutput%
%longserviceoutput%
Date/Time: %datetime%

Respond: %responseurl%
Nagios URL: %xiserverurl%
I get some messages that are sent this way but on the Contact Templates messages I get messages that don't line up to what I have specified above.

Code: Select all

Host Subject: PROBLEM Host Alert - HOSTNAME is DOWN

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


Nagios has detected a problem with this host.

Notification Type: PROBLEM
Host: HOSTNAME
State: DOWN
Address: IP ADDRESS
Hostgroup: %hostgroupnames%
Info: PING CRITICAL - Packet loss = 100%
Date/Time: 2015-08-03 11:19:13
Host Notes: %hostnotes%
Host Duration: %hostduration%

Respond: https://<nagios_xi_server>/nagiosxi/rr.php?uid=49-23548-3a901feea897a197e095f483933f1de3
Nagios URL: https://<nagios_xi_server>/nagiosxi/



I am trying to remove the Hostgroup and Host Notes/Duration to eliminate any confusion for our end-users since there is nothing populated there. This contact should be using the notify-host-by-email so not sure if that is configured elsewhere or where all these notifications are managed. I was trying to figure out where and how to create a custom notification but I am trying to walk before I start running. :)

Re: Email Notifications Different for Contact Templates

Posted: Mon Aug 03, 2015 11:21 am
by ssax
The notification templates will only work with contacts that use xi_host_notification_handler / xi_service_notification_handler.

Taken from Admin > Notification Management.
This component will only update notification settings for contacts that are created by Nagios XI, or contacts created according to the following documentation: http://assets.nagios.com/downloads/nagi ... ntacts.pdf
You would need to modify the commands (notify-host-by-email / notify-service-by-email) under Configure > Core Config Manager > Commands in order to edit their templates.