HTML e-mail

HTML_e_mail

This is a Unix /bin/sh script that is designed to be called as a Nagios command. It generates an HTML formatted message and passes it to sendmail (by default) for delivery.

Simply edit the first few variables to suit your system, place this file wherever Nagios can get to it (like /usr/local/nagios/libexec) and then edit your misccommands.cfg file to include two new commands:

define command {
    command_name service-notify-html-email
    command_line /usr/local/nagios/libexec/notify-html-email.sh service
}

define command {
    command_name host-notify-html-email
    command_line /usr/local/nagios/libexec/notify-html-email.sh host
}

Now you can use these commands in your contacts.cfg

Version 1.7 includes Nagios 3.x compatibility and style.

I have also included a script to test fire Nagios notifications. It reads the Nagios configuration files, populates the NAGIOS_ variables with test data and executes whatever notification for that contact you have configured. It is not related to notify-html-email but I found it very handy during development and testing so I have included it here.

To use:

nagios-notify-test (contact_id)