“But can you make the alerts look nicer?”
I’ve always liked the simple, plain text, easily customized commands used for email and SMS alerting in Nagios. I recently set up SMS alerting using nagios-twilio and some custom alert commands. Knowing this, I knew it would be possible to add HTML formatted alerts, and easily too.
I did a quick google and found the following blog post from Voxer, and accompanying github project. I’ve long been tempted by Etsy’s HTML email generating NOW WITH CONTEXT, nagios-herald which I discovered in this excellent blog blog however I hadn’t been running anything graphing perfdata up until recently.
nagios-html-email was pretty straight forward:
As the README states, you need the notification commands. I chose to add a new command instead of replacing the existing one.
In my case, I had to replace
sendmail because the emails were coming through with literal HTML code in them instead of being interpreted. I also had to edit the first line of the script at
/usr/local/bin/nagios-html-email to change
At this point I tested a few test notifications and was was quite pleased with the default notification template. I am going to run it for a while and see what I’d like to customize.