aboutsummaryrefslogtreecommitdiff
path: root/plugins-scripts
diff options
context:
space:
mode:
authorGravatar Ton Voon <ton.voon@opsera.com> 2010-07-07 09:56:21 +0100
committerGravatar Ton Voon <ton.voon@opsera.com> 2010-07-07 09:56:21 +0100
commit0205c7c0cfc5ba182f2cb675d1df4de72f13c9e2 (patch)
tree0b93504da05b4fd02c72dc42efb25397ffef83d5 /plugins-scripts
parentcf2bcf6c7afa8eb7a54e01f98a9998a7e1ac0852 (diff)
downloadmonitoring-plugins-0205c7c0cfc5ba182f2cb675d1df4de72f13c9e2.tar.gz
Allow check_ifstatus to accept version=2c
Diffstat (limited to 'plugins-scripts')
-rwxr-xr-xplugins-scripts/check_ifstatus.pl7
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins-scripts/check_ifstatus.pl b/plugins-scripts/check_ifstatus.pl
index 22638234..63c71ffa 100755
--- a/plugins-scripts/check_ifstatus.pl
+++ b/plugins-scripts/check_ifstatus.pl
@@ -280,7 +280,7 @@ sub process_arguments() {
$status = GetOptions(
"V" => \$opt_V, "version" => \$opt_V,
"h" => \$opt_h, "help" => \$opt_h,
- "v=i" => \$snmp_version, "snmp_version=i" => \$snmp_version,
+ "v=s" => \$snmp_version, "snmp_version=s" => \$snmp_version,
"C=s" => \$community,"community=s" => \$community,
"L=s" => \$seclevel, "seclevel=s" => \$seclevel,
"a=s" => \$authproto, "authproto=s" => \$authproto,
@@ -317,7 +317,10 @@ sub process_arguments() {
$timeout = $TIMEOUT;
}
- if ($snmp_version !~ /[123]/){
+ # Net::SNMP wants an integer
+ $snmp_version = 2 if $snmp_version eq "2c";
+
+ if ($snmp_version !~ /^[123]$/){
$state='UNKNOWN';
print ("$state: No support for SNMP v$snmp_version yet\n");
exit $ERRORS{$state};