index 4f17711680770bdaaf4fdaaa1367ca3a72e8d632..1a168bf013961a4b3ff56062ad37aaf30889e8a3 100755 (executable)
'6','notPresent',
'7','lowerLayerDown'); # down due to the state of lower layer interface(s));
+my $timeout ;
my $state = "UNKNOWN";
my $answer = "";
my $snmpkey=0;
}
-alarm($TIMEOUT);
+alarm($timeout);
push(@snmpoids,$snmpIfOperStatus);
push(@snmpoids,$snmpIfAdminStatus);
$ifexclude,
$ifunused);
}
-my $perfdata = sprintf("up:%d,down:%d,dormant:%d,excluded:%d,unused:%d",$ifup,$ifdown,$ifdormant,$ifexclude,$ifunused);
+my $perfdata = sprintf("up=%d,down=%d,dormant=%d,excluded=%d,unused=%d",$ifup,$ifdown,$ifdormant,$ifexclude,$ifunused);
print ("$state: $answer |$perfdata\n");
exit $ERRORS{$state};
printf " in hex with 0x prefix generated by using \"snmpkey\" utility\n";
printf " privacy password and authEngineID\n";
printf " -M (--maxmsgsize) Max message size - usefull only for v1 or v2c\n";
+ printf " -t (--timeout) seconds before the plugin times out (default=$TIMEOUT)\n";
printf " -V (--version) Plugin version\n";
printf " -h (--help) usage help \n\n";
print_revision($PROGNAME, '$Revision$');
"I" => \$ifXTable, "ifmib" => \$ifXTable,
"x:s" => \$opt_x, "exclude:s" => \$opt_x,
"u=s" => \$opt_u, "unused_ports=s" => \$opt_u,
- "M=i" => \$maxmsgsize, "maxmsgsize=i" => \$maxmsgsize);
+ "M=i" => \$maxmsgsize, "maxmsgsize=i" => \$maxmsgsize,
+ "t=i" => \$timeout, "timeout=i" => \$timeout,
+ );
if ($status == 0){
print_help() ;
exit $ERRORS{'OK'};
}
+ unless (defined $timeout) {
+ $timeout = $TIMEOUT;
+ }
if ($snmp_version =~ /3/ ) {
# Must define a security level even though default is noAuthNoPriv