Recently, I posted about using coffee-script and node-mailer to send custom Nagios notification emails. While it is a great way of extending the capabilities of Nagios Alerts by allowing any arbitrary hook into other coffee / javascript apis (such as node-mailer), it is also capable of creating pretty HTML e-mails with the help of the Jade template engine.
Since I've already created the Nagios Command and bound it to my contact information, all I need to do is install jade into the project folder's node_modules:
$ npm install jade
We then need to create our templates. Since I wanted to use a layout, I created a jade sub-folder in my projects folder.
Here is the layout (./jade/layout.jade):
Here is a neat header bar that I'm using(./jade/nav-bar-email.jade):
Here is the alert e-mail(./jade/nagiosAlert.jade):
Here is what my notify-service.coffee script looks like(/opt/bin/notify-service.coffee):
The final result is a pretty looking E-Mail. I'm viewing this with Mail.app in OS X. Ive blanked out a few bits. Just imagine there is Company Text to the left of home and a link between home and projects in the nav-bar
Blog Archive
-
▼
2013
(50)
-
▼
August
(18)
- Remembering Martin Luther King
- Babysitter sexually abused young boys
- How the Video Game Sacked Its Rivals
- Mutoh America Exhibits
- Using classical inheritance to contain express con...
- Always Consult A SBI Car Loan EMI Calculator to Ge...
- Kean computer science students in Union travel 'be...
- Latest traveling exhibit to open at ECHO
- Custom Nagios Notifications, now with Jade
- Simple Callbacks - Executing parallel and dependen...
- Police storm camps supporting ousted president
- School around the corner
- Capital's role in the economic crisis
- With a Little Bashing
- Okanagan College Esthetics program scores
- 2013 Ford Escape
- Async HTML5 File Uploads with Node / Express Frame...
- Tictail’s trick for easy e-commerce
-
▼
August
(18)
Popular Posts
-
I recently found an interesting article on a simple hack to get the existing image upload feature in CKEditor 3 enabled and functioning wi...
-
Mutoh will be introducing a new G7-enabled process control solution for its ValueJet family. Working in conjunction with ColorMetrix Technol...
-
A global leader in professional skin care has partnered with Okanagan College to offer students in the new and enhanced Esthetics and Nail T...
-
Firefighters know the importance of home fire safety. That's why the men and women of your Los Angeles Fire Department urge you to chan...
-
ENCINO - Over 100 Los Angeles Firefighters battled a huge blaze raging at an Encino home that injured two Captains and two Firefighters on ...
-
SAN FERNANDO - The Los Angeles Fire Department (LAFD) including a Hazardous-Materials (Haz-Mat) Team battled a small fire on October 30, 2...
-
The Los Angeles Fire Department and Los Angeles County Fire Department are joined by the world renowned Grossman Burn Centers in asking y...
-
For the estimated 80 million domestic cats that are kept as house pets, there are as many roaming free. Those numbers shouldn't be surpr...
-
Did you know there are different types of smoke alarms that are better at alerting you to different types of fires? Ionization smoke alarm...