Posts Tagged ‘Nagios’

Arduino server room monitor

October 1, 2010 7 comments

I just finished building an Arduino-based server room environment monitor using a kit from Sproutboard. It is a pretty nice kit for the cost. The kit plus the Arduino and ethernet shield from Sparkfun comes in at under $250.

For that $250 and a bit of manual labor, I am able to see ambient temperature, humididty, incoming A/C temperature, if the lights are on, if the door is open and whether there is water on the floor, all from a basic webpage. The system itself has a buzzer for an audible alarm if any conditions are outside your specified parameters (positive test for water on floor, ambient temp > 80, etc). I also built a quick script for my Nagios system that pulls data from the web page so I get email/SMS alerts as well.

The code is really easy to work with. If you have ever done any C/C++ work you should feel right at home. I spent some time modifying the code so the system works exactly as I want it to. Can’t do that with many off-the-shelf systems.

I liked the system so much that I bought several more to send out to our remote offices. Some of our remote sites have a “server room” that is little more than a storage closet. It will be nice to have hard numbers on what the temperature is in those rooms.

Looking downt the road a ways, I will probably be adding a single-chip smoke detector, and I might hook up an AC-powered relay plugged into an outlet that isn’t powered by our generator. That will allow me to get alerts when we lose utility power.

You can also adapt this same system to monitor your house, control a greenhouse, etc. The Sproutboard site has lots of ideas. Check it out.

Categories: Tech Tags: , ,

Nagios alerts via SMS with gnokii (tutorial)

September 23, 2010 Leave a comment

Like many IT professionals, I use nagios to monitor many systems and services. Some of these are security related (the SIEM system just registered an incident), while others can span both operational and security disciplines (the web server is down…why is the web server down?).

While all of the geeks I work with are able to get email alerts 24/7 through the magic of smart phones, there were still potential gaps in this method of notification. What if the email server is down? How about if the active sync server, firewall, internet connection, or core switching is down?

Getting alerts via SMS seemed like a great solution to this problem. My initial route to this functionality was using the cell provider’s email-to-SMS gateway. This provided alerts that went out if the mail or active sync servers were down, but didn’t really address a failure at the firewall, internet connection or switching infrastructure.

Some people I bounced ideas off of suggested using a cellular modem (a.k.a. air card). This did seem possible, but getting the system to dial out when needed seemed overly complex. A Verizon MiFi was also suggested. While that lacked the complexity, I was worried that the always-on connection could function as a back-door into the network. What I really wanted was a way to send SMS messages directly via the cell network.

Since I have an android phone with root access, I was hoping to find a way to use Android’s native debugging system (adb) to create a text message using the adb shell and a simple shell script. I failed to find a way to do this. I’d still like to figure out a way to make this happen, so please leave a comment if you have solved this puzzle!

Giving up on the Android route, a little googling led me to gnokii. gnokii is designed to have some pretty wide-ranging functionality, but all I wanted it for was the ability to send an SMS message via an attached cell phone. I went down several blind alleys before I got a working system set up, but I did finally get it running. I happy to say it works exactly as I had hoped. Click here for the full tutorial.

Categories: Tech Tags: , ,