From 5fd60a5359f3addde81f0d8f15af400371793572 Mon Sep 17 00:00:00 2001 From: caronpe Date: Mon, 17 Aug 2015 17:19:39 +0200 Subject: [PATCH] bug correction the ITEMP information is write " 23 C" not " 23 C internal". correct the bug: #/usr/lib/nagios/plugins/Centreon/SNMP/centreon-plugins/centreon_plugins.pl --plugin=apps::apcupsd::local::plugin --mode=temperature Use of uninitialized value $valueok in numeric eq (==) at /usr/lib/nagios/plugins/Centreon/SNMP/centreon-plugins/apps/apcupsd/local/mode/libgetdata.pm line 52. CRITICAL: NO DATA FOUND | --- apps/apcupsd/local/mode/libgetdata.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/apcupsd/local/mode/libgetdata.pm b/apps/apcupsd/local/mode/libgetdata.pm index bbde00deb..2bd300877 100644 --- a/apps/apcupsd/local/mode/libgetdata.pm +++ b/apps/apcupsd/local/mode/libgetdata.pm @@ -41,7 +41,7 @@ sub getdata { my ($value); #print $stdout; foreach (split(/\n/, $stdout)) { - if (/^$searchpattern\s*:\s*(.*)\s(Percent Load Capacity|Percent|Minutes|Seconds|Volts|Hz|seconds|C Internal|F Internal)/i) { + if (/^$searchpattern\s*:\s*(.*)\s(Percent Load Capacity|Percent|Minutes|Seconds|Volts|Hz|seconds|C|F Internal)/i) { $valueok = "1"; $value = $1; #print $value; @@ -60,4 +60,4 @@ sub getdata { }; }; -1; \ No newline at end of file +1;