TME - Ethernetový teploměr, plugin pro Nagios  
Plugin pro NAGIOS pro odečítání teploty TME čidla od www.papouch.cz.

HTML/XML output z cidla:

<?xml version="1.0" encoding="iso-8859-1" ?><thermometer><title>Ethernet thermometer TME designed by Papouch s.r.o. - www.papouch.com</title><description>TME Serverovna</description><temperature>230</temperature><mintemperature>"N"</mintemperature><maxtemperature>"N"</maxtemperature></thermometer>


TME je teploměr s rozhraním Ethernet (IP teploměr). Má interní WEBové stránky a XML stránku s aktuální teplotou. Umí protokoly TCP, SNMP, SMTP (e-mail), MODBUS a SOAP. Teplotu snadno vložíte na Vaše stránky díky funkci HTTP GET.


Plugin: check_temp

#!/bin/bash

# version 1.0 (27/01/2008)

W_TEMP=250 # warning treshold
C_TEMP=300 # critical treshold
URL="http://192.168.24.221/tme.xml"

cd /tmp

wget -q --output-document=$$.xml ${URL}
if [ $? -gt 0 ]; then
echo "UNKNOWN - can't connect to sensor!"
exit 3
fi


XML=`grep "<temperature>" $$.xml 2>/dev/null #1>&2`; RETVAL=$?

[ -f $$.xml ] && rm -f $$.xml

if [ $RETVAL -gt 0 ]; then
echo "UNKNOWN - no data from sensor!"
exit 3
fi

TEMP=`echo ${XML} | \
awk -F"<temperature>" '{ print $2 }' | \
awk -F"</temperature>" '{ print $1 }'`

TEMP_DOT=`echo $TEMP / 10 | bc`

# temp is okay
if [ $TEMP -lt $W_TEMP ]; then
echo "OK - temperature is ${TEMP_DOT}C |${TEMP}"
exit 0
fi

# temp is over W_TEMP
if [ $TEMP -gt $C_TEMP ]; then
echo "CRITICAL - temperature is ${TEMP_DOT}C |${TEMP}"
exit 2
else
echo "WARNIG - temperature is ${TEMP_DOT}C |${TEMP}"
exit 1
fi


[ add comment ] ( 2 views )   |  [ 0 trackbacks ]   |  permalink

<<First <Back | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | Next> Last>>