TemPageR 3E environment monitor

Recently ran into some heat issues in a mini computer room that has a window in direct line of the sun and problematic HVAC. Picked up a network enabled environment monitor so I could have some data to show when trying to get the issues resolved. Originally I was thinking about getting the Websensor EM01B that has been featured on the nagios website for ages and ages. I also investigate getting an APC unit that could plug directly into our UPS. I ended up settling on the AVTECH TemPageR 3E mostly because of price. It was cheaper than most of the options and it came with an external temp probe in addition to the integrated probe.

All in all I am happy with it. I wrote some quick and dirty nagios and munin plugins that monitor the unit via SNMP. The web interface renders data using JSON, so it would be possible to write some plugins that used that as well, but I ran the JSON through a validator after having the ruby json libs blow up, and its not 100% valid so I stuck with SNMP.

I had to contact support and so far the support has been really good. I was noticing that my graphs had gaps in them. I started doing some debugging and found that sometimes SNMP queries of the external temp probe return nothing. I contacted support and they suggested that I check to make sure that the wiring for the external probe does not run near any HVAC gear or other sources of electrical interference. After some rewiring I have managed to escape most of the interference and reduced the amount times SNMP queries for the external probe fail.

munin graph

Here is the shell script munin plugin. I doubt it complies 100 percent with their plugin requirements. Use at your own risk:

#!/bin/bash
GRAPH_TITLE="TITLE"
GRAPH_VLABEL="Degrees Fahrenheit"
S1_LABEL="Integrated Sensor"
S2_LABEL="External Sensor"
COMMUNITY="snmp_com_here"
HOST="1.1.1.1"
SNMPWALK="/usr/bin/snmpwalk"

#provide autoconf to munin
if [ "${1}" == "config" ];then
        echo graph_title ${GRAPH_TITLE}
        echo graph_vlabel ${GRAPH_VLABEL}
        echo sensor1.label ${S1_LABEL}
        echo sensor2.label ${S2_LABEL}
else

        #Get the values via SNMP. They are reported with out the decimal place so we do an ugly sed one liner to clean it up

        VALUE=$(${SNMPWALK} -v1 -c ${COMMUNITY} ${HOST} enterprises.20916.1.7.1.1.1.2.0 | awk '{print $4}'  | sed 's/..$/.&/;t;s/^.$/.0&/')
        echo sensor1.value ${VALUE}

        VALUE=$(${SNMPWALK} -v1 -c ${COMMUNITY} ${HOST} enterprises.20916.1.7.1.2.1.2.0 | awk '{print $4}'  | sed 's/..$/.&/;t;s/^.$/.0&/')
        echo sensor2.value ${VALUE}

fi

Here is the nagios plugin, same disclaimer:

#!/bin/bash
COMMUNITY="snmp_com_here"
HOST="1.1.1.1"
SNMPWALK="/usr/bin/snmpwalk"
WARNING=90
CRITICAL=95

        #Get the values via SNMP. They are reported with out the decimal place so we do an ugly sed one liner to clean it up

        VALUE1=$(${SNMPWALK} -v1 -c ${COMMUNITY} ${HOST} enterprises.20916.1.7.1.1.1.2.0 | awk '{print $4}'  | sed 's/..$/.&/;t;s/^.$/.0&/')

        VALUE2=$(${SNMPWALK} -v1 -c ${COMMUNITY} ${HOST} enterprises.20916.1.7.1.2.1.2.0 | awk '{print $4}'  | sed 's/..$/.&/;t;s/^.$/.0&/')

if [ ${VALUE1} \< ${WARNING} ] && [ ${VALUE2} \< ${WARNING} ];then
        echo "TEMP OK: "${VALUE1} ${VALUE2}
        exit 0

elif [ ${VALUE1} \> ${WARNING} ] || [ ${VALUE2} \> ${WARNING} ]; then

        if [ ${VALUE1} \> ${CRITICAL} ] || [ ${VALUE2} \> ${CRITICAL} ];then
                echo "TEMP CRITICAL: "${VALUE1} ${VALUE2}
                exit 2
        else
                echo "TEMP WARNING: "${VALUE1} ${VALUE2}
                exit 1
        fi

else
        echo "UKNOWN"
        exit 3
fi
This entry was posted in /StupidShellTricks, /geek, /sysadmin, /unix, /work. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

CommentLuv Enabled