This is a cache of https://support.nagios.com/kb/article/nagios-xi-email-notifications-with-color-527.html. It is a snapshot of the page at 2025-05-12T01:56:46.116+0000.
Nagios <strong>xi</strong> - Email Notifications With Color
Home » Categories » Products » Nagios xi » Documentation » Notifications

Nagios xi - Email Notifications With Color

Overview

The notification messages sent out from Nagios xi can be formatted with Cascading Style Sheets (CSS) to produce emails that contain color.

The css allows the colour to be different depending on the state (UP / DOWN / UNREACHABLE / OK / WARNING / CRITICAL / UNKNOWN).

It is not possible for the SUBJECT of the email to have color.

 

 

Update Notification Messages

This change needs to be performed for each user.

When logged into Nagios xi, at the top right corner click the username (like nagiosadmin).

You are taken to the user account preferences.

Under Notification Options click Notification Messages

Here you need to update your HOST and SERVICE messages. The following examples add the CSS code to the messages.

 

Host Alert Message

<html>
  <head>
    <style>.OK {color:green;}.WARNING {color:yellow;}.UNKNOWN {color:orange}.CRITICAL {color:red}</style>
  </head>
  <body>
<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%
</body>
</html>

 

Service Alert Message

<html>
  <head>
    <style>.OK {color:green;}.WARNING {color:yellow;}.UNKNOWN {color:orange}.CRITICAL {color:red}</style>
  </head>
  <body>
<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%

</body>
</html>

 

Once you've made the required changes click the Update Settings button at the bottom of the screen.

 

As mentioned earlier, this change needs to be performed for each user. If you have the Enterprise Edition license you can use the Notification Management component to apply these message templates to your users (Admin > Users > Notification Management).

 

 

Final Thoughts

For any support related questions please visit the Nagios Support Forums at:

http://support.nagios.com/forum/



Special Offer For Knowledgebase Visitors! Get a huge discount on Nagios Log Server by clicking below.

Get 60% Off Nagios Log Server!

Did you know? Nagios provides complete monitoring of: Windows, Linux, UNIX, Servers, Websites, SNMP, DHCP, DNS, Email, Storage, Files, Apache, IIS, EC2, and more!

1 (1)
Article Rating (1 Votes)
Rate this article
  • Icon PDFExport to PDF
  • Icon MS-WordExport to MS Word
Attachments Attachments
There are no attachments for this article.
Related Articles RSS Feed
Nagios xi - Understanding Email Sending
Viewed 11693 times since Tue, May 2, 2017
Nagios xi - Setup Nagios xi to Send SMS Alerts
Viewed 9872 times since Thu, Jan 28, 2016
Nagios xi - Integrating Slack With Nagios xi
Viewed 4463 times since Sun, Jul 9, 2017
Nagios xi - Sending SNMP Traps
Viewed 7942 times since Thu, Jan 28, 2016
Nagios xi - Configuring Downtime
Viewed 18165 times since Wed, Sep 28, 2016
Nagios xi - Inbound Email Commands
Viewed 4891 times since Mon, Apr 29, 2019
Nagios xi - Understanding Notification Variables
Viewed 8790 times since Thu, Jan 28, 2016
Nagios xi - Configuring Notification Preferences
Viewed 7833 times since Wed, Jul 19, 2017
Nagios xi - Multi-Tech iSMS Integration
Viewed 5712 times since Thu, Jan 28, 2016
Nagios xi - Managing Mobile Carriers
Viewed 5330 times since Wed, Jul 19, 2017