2007
01.16

The company I work for recently moved into a new office building and subsequently a new computer room. The server room is very small and our server rack barely fits inside it. We have an indepentent AC system doing the cooling for it, but it still needs some sort of temperature monitoring in place to make sure that if the AC unit fails, then someone knows about it pronto. The most “off-the-shelf” stuff are the NetBotz units made by APC. They are plug-and-play network boxes that monitor everything you can think of. They also start at about $1000.

I went on the search for a cheaper alternative and found the 1-wire temp/humidity/flood sensors provided by iButtonLink. They are just the bare sensors with serial connectors for interfacing. The software to query the sensors is called digitemp and runs on Linux and Windows. We already have a monitoring script that runs every 10 minutes to check if certain critical services are down, so modifying it was easy. You can do it with some simple Bash code:

mailto="admin@domain.com"
maxtemp=75

temp=`digitemp -t0 -q -o3 | tr ’.’ ’ ’ | awk ’{print $2}’`
if [ $temp -gt $maxtemp ]; then
   echo "The server room is above the critical 
   temp threshold of $maxtemp." | 
   mail -s "CRITICAL TEMP: $temp" $mailto
fi

Just run that from a cron job every few minutes and you’re good to go. I’m not interested in humidity/water monitoring at the moment, but I’ll post an update as soon as I get those running with some more code.

No Comment.

Add Your Comment