[BACK]Return to check_hw_sensors CVS log [TXT][DIR] Up to [local] / nagios / check_hw_sensors

Diff for /nagios/check_hw_sensors/check_hw_sensors between version 1.27 and 1.28

version 1.27, 2009/11/09 22:51:44 version 1.28, 2009/11/09 22:58:41
Line 1 
Line 1 
 #!/usr/bin/perl -T  #!/usr/bin/perl -T
 # $RedRiver: check_hw_sensors,v 1.26 2009/11/09 21:25:07 andrew Exp $  # $RedRiver: check_hw_sensors,v 1.27 2009/11/09 22:51:44 andrew Exp $
 ########################################################################  ########################################################################
 # check_hw_sensors *** A nagios check for OpenBSD sysctl hw.sensors  # check_hw_sensors *** A nagios check for OpenBSD sysctl hw.sensors
 #  #
Line 45 
Line 45 
   
 my $state = 'UNKNOWN';    # tells whether the it is warning, critical, or OK  my $state = 'UNKNOWN';    # tells whether the it is warning, critical, or OK
 my %states;               # This stores the count of states;  my %states;               # This stores the count of states;
 my $filename;  my $opt_V;
   my $opt_h;
 my $ignore_status;  my $ignore_status;
   my $filename;
 my $sensor;  my $sensor;
 my $warning;  my $warning;
 my $critical;  my $critical;
 my $opt_h;  
 my $opt_V;  
   
 my $CHECK_SENSOR = $BASE;  my $CHECK_SENSOR = $BASE;
 my %CHECKS;  my %CHECKS;
Line 61 
Line 61 
 my $status = GetOptions(  my $status = GetOptions(
     "version|V"       => \$opt_V,      "version|V"       => \$opt_V,
     "help|h"          => \$opt_h,      "help|h"          => \$opt_h,
     "filename|f:s"    => \$filename,  
     "ignore-status|i" => \$ignore_status,      "ignore-status|i" => \$ignore_status,
       "filename|f:s"    => \$filename,
     "sensor|s=s"      => \$sensor,      "sensor|s=s"      => \$sensor,
     "warning|w=s"     => \$warning,      "warning|w=s"     => \$warning,
     "critical|c=s"    => \$critical,      "critical|c=s"    => \$critical,
Line 123 
Line 123 
 }  }
   
 if ($opt_h  if ($opt_h
     || ( ( !defined $filename ) && ( !defined $sensor ) )      || (   ( !defined $filename )
           && ( !defined $sensor )
           && ( !defined $ignore_status ) )
   
     #|| ( defined $sensor && !( $warning || $critical ) )      #|| ( defined $sensor && !( $warning || $critical ) )
     )      )
Line 214 
Line 216 
         $r = check_sensor( $SENSORS{$s}, $CHECKS{$s} );          $r = check_sensor( $SENSORS{$s}, $CHECKS{$s} );
         $data = $s . '=' . $SENSORS{$s}{'output'};          $data = $s . '=' . $SENSORS{$s}{'output'};
     }      }
     elsif ( not $ignore_status ) {      elsif ( !$ignore_status ) {
         $r    = check_sensor( $SENSORS{$s} );          $r    = check_sensor( $SENSORS{$s} );
         $data = $s . '=' . $SENSORS{$s}{'output'};          $data = $s . '=' . $SENSORS{$s}{'output'};
     }      }

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.28

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>