From ca532c29059c43425f786be190bb191db820c834 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torben=20H=C3=B8rup?= Date: Sat, 13 Aug 2016 12:33:41 +0200 Subject: [PATCH] Fix temperature calculation, for when temperatures are below 10 degrees Celcius (#26) --- nagios/check-roomalert.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nagios/check-roomalert.pl b/nagios/check-roomalert.pl index 6d4652d..ef7f94f 100755 --- a/nagios/check-roomalert.pl +++ b/nagios/check-roomalert.pl @@ -89,8 +89,8 @@ if($warn[1] > $crit[1]) { our $snmp_session = _create_session($opt{'host'},$opt{'com'}); my $internal = _get_oid_value($snmp_session,$s_internal); my $external = _get_oid_value($snmp_session,$s_external); -$internal = int(substr($internal,0,2) . "." . substr($internal,2,2)); -$external = int(substr($external,0,2) . "." . substr($external,2,2)); +$internal = $internal / 100.0; +$external = $external / 100.0; my $istat = 0; my $estat = 0;