From 36e46c0037fcb92d0cad170e0a17f4eddc732026 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Wed, 9 Dec 2009 17:06:28 +0100 Subject: [PATCH] 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. --- dsa-nagios-checks/checks/dsa-check-hpasm | 14 ++++++++------ dsa-nagios-checks/debian/changelog | 8 ++++++++ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/dsa-nagios-checks/checks/dsa-check-hpasm b/dsa-nagios-checks/checks/dsa-check-hpasm index 1a1c64a..029fc01 100755 --- a/dsa-nagios-checks/checks/dsa-check-hpasm +++ b/dsa-nagios-checks/checks/dsa-check-hpasm @@ -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; diff --git a/dsa-nagios-checks/debian/changelog b/dsa-nagios-checks/debian/changelog index b2cffd1..15a7017 100644 --- a/dsa-nagios-checks/debian/changelog +++ b/dsa-nagios-checks/debian/changelog @@ -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 Wed, 09 Dec 2009 17:05:42 +0100 + dsa-nagios-checks (84) unstable; urgency=low [ Peter Palfrader ] -- 2.20.1