Support for snmpforce_v1, snmpforce_v2, snmpforce_v3

This commit is contained in:
Oliver Gorwits
2014-01-08 05:37:44 +00:00
parent 0c1be4e900
commit f3f55748b5
4 changed files with 33 additions and 21 deletions

View File

@@ -96,9 +96,12 @@ sub _snmp_connect_generic {
$snmp_args{AutoSpecity} = 1;
}
# TODO: add version force support
# use existing SNMP version or try 3, 2, 1
my @versions = reverse (1 .. (setting('snmpver') || 3));
# which SNMP versions to try and in what order
my @versions =
( check_no($device->ip, 'snmpforce_v3') ? (3)
: check_no($device->ip, 'snmpforce_v2') ? (2)
: check_no($device->ip, 'snmpforce_v1') ? (1)
: (reverse (1 .. (setting('snmpver') || 3))) );
# get the community string(s)
my @communities = _build_communities($device, $mode);