Friday, May 25, 2012


Nagios is billed as a network, infrastructure monitoring app.

There is a wiki definition of it.

To me, it has saved my butt more than a hundred times. In simple terms, it is a system I use to monitor my company's network, server and entire IT assets. When a mail server goes down, I am instantly paged and notified. This is the tool used to monitor your servers,switches, hardware for downtime.

This is one of the killer "Linux" apps. Sure, it probably runs on other platforms. And sure, there are probably other 'infrastructure' monitoring apps that work with Windows with minimal fuss. However, Nagios is free and runs on minimal hardware. In essence, cheap. It takes an afternoon of your time to configure some /etc/ files. Trust me, you will be rewarded in so many intangible ways.

Nagios was one of those first examples of how IT snuck in Linux boxes into the closets of most enterprises. About 7-8 years ago, I built an inexpensive Linux rack server from the local white box computer shop. Back when I was younger and piecing motherboards together was my idea of fun, Linux started to become my de-facto go-to solution for everything.  The entire cost of the project was a few hundred dollars using the cheapest PC components we could scrape together.

With Nagios, I would know way beforehand when a mail server went down. I would prefer a machine to tell me something is wrong versus the boss calling and telling me why he/she can't get his mail.

The years went by and the box did its job. About two years ago, as we started to consolidate physical machines into virtualized machines. It also gave me a reason to upgrade to version 3 from whatever I was running previously. I rebuilt a Nagios instance on a small JeOS (Just enough OS) build of Ubuntu. It was very minimal, very small, and very lightweight. Console only, the VM image was portable enough to be put on a small USB stick. That is the power of Linux.

In short, all you really need to do is make some config files and enable the service. It runs as a daemon. The most common action is obviously notification. You can also script external commands. A nifty thing to do is launch a VM failover in the event that a primary server is unavailable.
Typical email responses from Nagios

Everything is routed to my iPhone. I've been blogging about various Android devices in my other posts so now it is time to give some iPhone love. The iPhone/iPad is the only tool I depend on using with Nagios.I can access and configure my Nagios box from anywhere my iPhone has a signal:

1) I have a secured CISCO VPN tunnel  that works flawlessly with iOS (It has problems with ICS sandwich). If I can't connect to my network, a whiz-bang dual core 4.7 720p screen is of no use to me.
2) I get notifications via PUSH notifications via dovecot/cyrus IMAP mail server. My Galaxy Nexus only supports PUSH emails via GMAIL or Exchange. K-9 email client in the Play store doesn't work for me.
3) Excellent console access. I prefer the SSH  app on my 3.5" small iPhone screen over Android's Connectbot running on my 4.65" Galaxy Nexus or 7" Galaxy Tab 2.

It is all about usability and the iPhone works. Android is flakey with PUSH IMAP and others have suggested I use SMS. It is critical that I get notified within a few seconds versus 5-10 minutes later. Now, you see why the iPhone works for me.

You can configure Nagios to send SMS but I've had both ATT and Verizon block my message because my notifications did not come from a mail server with proper MX records (e.g. if my primary mail server goes down!). In addition, the 30-40 messages that can come at once. I can see why they would be blocked it as SPAM. Hence, I configured Nagios to send alternate notifications to Cyrus/Dovecot IMAP. I love open source. I find it strange that Apple's iOS has better support for open source linux based mail servers than Google.

If you are serious about your network and infrastructure, I suggest you research Nagios and see if it will work for you.

To end, I am hoping I don't get any more  notification at 3AM  this Saturday night.

No comments:

Post a Comment