Writing commands to send notifications

Another part of Nagios that can be extended to fit your needs are notifications. These are messages that Nagios sends out whenever a problem occurs, or is resolved.

One way in which the Nagios notification system can be expanded is to create template-based e-mail sending. This will send notifications as both plain text and HTML messages. The template of the e-mail will be kept in separate files.

We will use two npm libraries: handlebars (http://handlebarsjs.com) for template processing and emailjs (https://github.com/eleith/emailjs) for the e-mail sending functionality.

E-mails that contain content in multiple formats need to be wrapped in the multipart/alternative MIME type. This type will contain two sub-parts—first ...

Get Learning Nagios - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.