skip absent temperature readings
[mirror/dsa-nagios.git] / dsa-nagios-checks / checks / dsa-check-hpasm
index 749b6d2..63505f3 100755 (executable)
@@ -83,7 +83,7 @@ sub do_dimm {
   }
 
   if ($return eq '') {
-    return "All DIMMS OK ($num_dimms) ";
+    return "DIMMS OK ($num_dimms) ";
   } else {
     return $return;
   }
@@ -206,7 +206,6 @@ sub do_temp {
       }
 
       $temp_num = $1;
-      $num_temp++;
       my @line = split /\s+/, $line;
 
       my $zone = $line[1];
@@ -215,6 +214,8 @@ sub do_temp {
 
       $current_temp =~ s/(.*)C.*/$1/;
       $threshold =~ s/(.*)C.*/$1/;
+      next if ($threshold eq '-');
+      $num_temp++;
 
       my $off = $threshold - $current_temp;
       if ($off <= 0) {
@@ -236,7 +237,7 @@ sub do_temp {
   }
 }
 
-my @output = `echo "$command"|hpasmcli 2>&1`;
+my @output = `echo "$command"|sudo hpasmcli 2>&1`;
 if (($? >> 8) != 0) {
   print "UNKNOWN: Can't exec hpasmcli: @output\n";
   exit 3;