Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Miniumum not always present. E.g. bsnmpd

  • Loading branch information...
commit 0d21b74e6b17cb29ad61dc4b4ca5cdab348550a1 1 parent 33d473a
@barryo authored
Showing with 8 additions and 3 deletions.
  1. +3 −3 check_chassis_cisco.pl
  2. +5 −0 check_disk_snmp.pl
View
6 check_chassis_cisco.pl
@@ -255,14 +255,14 @@ sub checkTemperature
$t_index = $1;
my $t_desc = $response->{$snmpTempDesc . '.' . $t_index};
- my $t_value = $response->{$snmpTempValue . '.' . $t_index};
- my $t_thres = $response->{$snmpTempThres . '.' . $t_index};
+ my $t_value = defined( $response->{$snmpTempValue . '.' . $t_index} ) ? $response->{$snmpTempValue . '.' . $t_index} : '?';
+ my $t_thres = defined( $response->{$snmpTempThres . '.' . $t_index} ) ? $response->{$snmpTempThres . '.' . $t_index} : '?';
my $t_state = $CISCO_ENVMON_STATES{$response->{$snmpTempState . '.' . $t_index}};
print( "Temp: $t_desc $t_value/$t_thres $t_state\n" ) if $verbose;
$tempdata = "Temp: " if( !defined( $tempdata ) );
- $tempdata .= "$t_value/$t_thres ";
+ $tempdata .= ( $t_value !~ m/\?/ ? "$t_value/$t_thres " : "$t_state " );
if( $t_state =~ m/WARNING/i || $t_state =~ m/SHUTDOWN/i || $t_state =~ m/NOTPRESENT/i || $t_state =~ m/NOTFUNCTIONING/i ) {
&setstate( 'WARNING', "Temperate state for $t_desc is: $t_state ($t_value/$t_thres)" );
View
5 check_disk_snmp.pl
@@ -173,6 +173,11 @@ sub checkDiskSpace
my $t_used = $response->{$snmpUsed . '.' . $t_index};
my $t_percentused = $response->{$snmpPercentUsed . '.' . $t_index};
+
+ if( !defined( $t_minpercent ) ) {
+ $t_minpercent = 0;
+ }
+
if( $devicesonly && $t_device !~ m/^\/dev\// ) {
next;
}
Please sign in to comment.
Something went wrong with that request. Please try again.