]> git.uio.no Git - check_openmanage.git/commitdiff
bugfix for temp_from_celsius() usage
authorTrond Hasle Amundsen <t.h.amundsen@usit.uio.no>
Thu, 29 Mar 2012 15:46:30 +0000 (17:46 +0200)
committerTrond Hasle Amundsen <t.h.amundsen@usit.uio.no>
Thu, 29 Mar 2012 15:46:30 +0000 (17:46 +0200)
CHANGES
check_openmanage

diff --git a/CHANGES b/CHANGES
index 9b210e8319f5c56e3c3dd39a7373526047d5d38f..d3a0e478e2343bc3e2495506825e24b6b04dd85b 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,9 @@
+3.7.5
+------------------
+
+* A bug was fixed which could lead to perl warnings when either of the
+  options '--tempunit' or '--fahrenheit' was used.
+
 3.7.4   2012-03-29
 ------------------
 
index c2ed15b444d6589bec7a5906347bff1bedbcc70f..c9ffe6d96f4a1b3e158322a323ada3251d710b29 100755 (executable)
@@ -49,7 +49,7 @@ $SIG{__WARN__} = sub { push @perl_warnings, [@_]; };
 
 # Version and similar info
 $NAME    = 'check_openmanage';
-$VERSION = '3.7.4';
+$VERSION = '3.7.5-beta1';
 $AUTHOR  = 'Trond H. Amundsen';
 $CONTACT = 't.h.amundsen@usit.uio.no';
 
@@ -2863,11 +2863,11 @@ sub check_enclosure_temp {
 
        # Convert temp units
        if ($opt{tempunit} ne 'C') {
-           $reading  = temp_from_celsius($reading,  $opt{tempunit});
-           $max_warn = temp_from_celsius($max_warn, $opt{tempunit});
-           $max_crit = temp_from_celsius($max_crit, $opt{tempunit});
-           $min_warn = temp_from_celsius($min_warn, $opt{tempunit});
-           $min_crit = temp_from_celsius($min_crit, $opt{tempunit});
+           $reading  = temp_from_celsius($reading,  $opt{tempunit}) if $reading  ne '[N/A]';
+           $max_warn = temp_from_celsius($max_warn, $opt{tempunit}) if $max_warn ne '[N/A]';
+           $max_crit = temp_from_celsius($max_crit, $opt{tempunit}) if $max_crit ne '[N/A]';
+           $min_warn = temp_from_celsius($min_warn, $opt{tempunit}) if $min_warn ne '[N/A]';
+           $min_crit = temp_from_celsius($min_crit, $opt{tempunit}) if $min_crit ne '[N/A]';
        }
 
        # Inactive temp probes
@@ -3544,11 +3544,11 @@ sub check_temperatures {
 
        # Convert temp units
        if ($opt{tempunit} ne 'C') {
-           $reading  = temp_from_celsius($reading,  $opt{tempunit});
-           $max_warn = temp_from_celsius($max_warn, $opt{tempunit});
-           $max_crit = temp_from_celsius($max_crit, $opt{tempunit});
-           $min_warn = temp_from_celsius($min_warn, $opt{tempunit});
-           $min_crit = temp_from_celsius($min_crit, $opt{tempunit});
+           $reading  = temp_from_celsius($reading,  $opt{tempunit}) if $reading  ne '[N/A]';
+           $max_warn = temp_from_celsius($max_warn, $opt{tempunit}) if $max_warn ne '[N/A]';
+           $max_crit = temp_from_celsius($max_crit, $opt{tempunit}) if $max_crit ne '[N/A]';
+           $min_warn = temp_from_celsius($min_warn, $opt{tempunit}) if $min_warn ne '[N/A]';
+           $min_crit = temp_from_celsius($min_crit, $opt{tempunit}) if $min_crit ne '[N/A]';
        }
 
        if ($type eq 'Discrete') {