Email recieve CRITICAL notification in red color

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
absarcompass
Posts: 182
Joined: Thu May 14, 2015 9:57 pm

Email recieve CRITICAL notification in red color

Post 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
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Email recieve CRITICAL notification in red color

Post 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'.
Former Nagios Employee
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Email recieve CRITICAL notification in red color

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
absarcompass
Posts: 182
Joined: Thu May 14, 2015 9:57 pm

Re: Email recieve CRITICAL notification in red color

Post by absarcompass »

Thanks mate :)
will definitely try that and let you guys know.

Cheers!
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Email recieve CRITICAL notification in red color

Post by mcapra »

Let us know what your results are!
Former Nagios employee
https://www.mcapra.com/
Locked