#!/bin/bash

STATE_OK=0
STATE_WARNING=1
STATE_CRITICAL=2
STATE_UNKNOWN=3
STATE_DEPENDENT=4

temp=`snmpget -v 1 -c $2 $1 1.3.6.1.4.1.18248.1.1.1.0 | sed "s/SNMPv2-SMI::enterprises.18248.1.1.1.0 = INTEGER: //" | cut -d" " -f1,4`

if [ "$temp" != "" ]
then
echo $(( $temp / 10 ))","$(( $temp % 10 )) " | temp="$(( $temp / 10 ))"."$(( $temp % 10 ))"C;$3;$4;; "
	if [ $(( $temp / 10 )) -lt $3 ] 
	then
		exit $STATE_OK
	else
		if [ $(( $temp / 10 )) -lt $4 ] 
		then
			exit $STATE_WARNING
		else
			exit $STATE_CRITICAL
		fi
	fi
else
	echo "Plugin fail | temp=0C;$3;$4;;"
exit $STATE_CRITICAL
fi

