dsa-check-hpasm: Not all things where a temperature can be measured might be installe...
authorPeter Palfrader <peter@palfrader.org>
Wed, 9 Dec 2009 16:06:28 +0000 (17:06 +0100)
committerPeter Palfrader <peter@palfrader.org>
Wed, 9 Dec 2009 16:06:28 +0000 (17:06 +0100)
dsa-nagios-checks/checks/dsa-check-hpasm
dsa-nagios-checks/debian/changelog

index 1a1c64a..029fc01 100755 (executable)
@@ -223,12 +223,14 @@ sub do_temp {
       $num_temp++;
 
       my $off = $threshold - $current_temp;
-      if ($off <= 0) {
-        $message = sprintf("TEMP zone=%s %sC/%sC ", $zone, $current_temp, $threshold);
-        $exit_status |= 2;
-      } elsif ($off < ($threshold/10)) {
-        $message = sprintf("TEMP zone=%s %sC/%sC ", $zone, $current_temp, $threshold);
-        $exit_status |= 1;
+      if ($current_temp ne '-') {
+        if ($off <= 0) {
+          $message = sprintf("TEMP zone=%s %sC/%sC ", $zone, $current_temp, $threshold);
+          $exit_status |= 2;
+        } elsif ($off < ($threshold/10)) {
+          $message = sprintf("TEMP zone=%s %sC/%sC ", $zone, $current_temp, $threshold);
+          $exit_status |= 1;
+        }
       }
     } elsif ($line =~ /($prompt|^\s*$)/) {
       last;
index b2cffd1..15a7017 100644 (file)
@@ -1,3 +1,11 @@
+dsa-nagios-checks (85) unstable; urgency=low
+
+  * dsa-check-hpasm: Not all things where a temperature can be measured
+    might be installed (e.g. a second CPU).  Don't do numeric computations
+    on a "-" instead of numbers then.
+
+ -- Peter Palfrader <weasel@debian.org>  Wed, 09 Dec 2009 17:05:42 +0100
+
 dsa-nagios-checks (84) unstable; urgency=low
 
   [ Peter Palfrader ]