Skip to content

Commit

Permalink
Dig deeper into fan checks
Browse files Browse the repository at this point in the history
  • Loading branch information
barryo committed Sep 13, 2015
1 parent 1215074 commit 27249d8
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions check_chassis_extreme.php
Expand Up @@ -196,12 +196,19 @@ function checkFans()

foreach( $fans as $i => $operational )
{
_log( "Fan: {$i} - " . ( $operational ? 'OK' : 'NOT OK' ) . " ({$speeds[$i]} RPM)", LOG__VERBOSE );
$fandata .= " [{$i} - " . ( $operational ? 'OK' : 'NOT OK' ) . " ({$speeds[$i]} RPM)];";
$ok = $operational && $speeds[$i] >= 2000;

_log( "Fan: {$i} - " . ( $ok ? 'OK' : 'NOT OK' ) . " ({$speeds[$i]} RPM)", LOG__VERBOSE );
$fandata .= " [{$i} - " . ( $ok ? 'OK' : 'NOT OK' ) . " ({$speeds[$i]} RPM)];";

if( !$operational ) {
if( !$ok ) {
setStatus( STATUS_CRITICAL );
$criticals .= "Fan {$i} is NOT operational";
if( $operational && $speeds[$i] < 2000 )
$criticals .= "Fan {$i} is operational but speed is outside normal operating range (<2000). ";
else if( !$operational )
$criticals .= "Fan {$i} is not operational. ";
else
$criticals .= "Fan {$i} is not operational (reason unknown). ";
}
}

Expand Down

0 comments on commit 27249d8

Please sign in to comment.