Page 1 of 1
Email recieve CRITICAL notification in red color
Posted: Thu May 19, 2016 7:39 pm
by absarcompass
Hi Guys,
Like the XI GUI notification is there a possibility that when we receive email having Critical in subject it pops in red color.
are there any script or some text edition to the command which can help?
thanks
Re: Email recieve CRITICAL notification in red color
Posted: Thu May 19, 2016 11:18 pm
by rkennedy
This actually won't work, as most email clients will not parse HTML in the subject line. Depending on what you're using though, you might be able to set up some filtering on your email client side to 'flag' subjects that contain 'CRITICAL'.
Re: Email recieve CRITICAL notification in red color
Posted: Fri May 20, 2016 1:49 am
by Box293
The content however can be customized with CSS and html.
Here's a post that was in the customer support section of the forum.
You can type any "custom" message in the "Host Alert Message" and "Service Alert Message" fields. You can use macros, and html/css tags to show some color. Here's an example of a "custom" host/service alert messages with some color
Code: Select all
<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%
Hostgroup: %hostgroupnames%
Info: %hostoutput%
Date/Time: %datetime%
Host Notes: <font color="green">%hostnotes%</font>
Host Duration: %hostduration%
Respond: <href a="%responseurl%">%responseurl%</a>
Nagios URL: %xiserverurl%
Code: Select all
<style type='text/css'>.OK {color:green;}.WARNING {color:yellow;}.UNKNOWN {color:orange}.CRITICAL {color:red}</style>
<h3 class='%servicestate%'>***** Nagios XI Alert *****</h3>
%alertsummary%
Notification Type: %type%
Service Name: %service%
Service Displayname: %servicedisplayname%
Service Group: %servicegroupnames%
State: <strong class='%servicestate%'>%servicestate%</strong>
Host Name: %host%
Hostalias: %hostalias%
Address: %hostaddress%
Hostgroup: %hostgroupnames%
Info:
%serviceoutput%
%longserviceoutput%
Date/Time: %datetime%
Service Notes: <font color="green">%servicenotes%</font>
Respond: %responseurl%
Nagios URL: %xiserverurl%
Once you set the template the way you want it, you can apply it to some users, or make it default for all users (if you are using Nagios XI Enterprise Edition). You can even lock the notification messages and settings for the selected non-admin users.
Hope this helps.
Re: Email recieve CRITICAL notification in red color
Posted: Sun May 22, 2016 8:37 pm
by absarcompass
Thanks mate

will definitely try that and let you guys know.
Cheers!
Re: Email recieve CRITICAL notification in red color
Posted: Mon May 23, 2016 9:39 am
by mcapra
Let us know what your results are!