snmp_remoteport setting to override port 161 for SNMP targets
This commit is contained in:
1
Changes
1
Changes
@@ -3,6 +3,7 @@
|
||||
[NEW FEATURES]
|
||||
|
||||
* #332 Autodiscovery via BGP and OSPF peers
|
||||
* snmp_remoteport setting to override port 161 for SNMP targets
|
||||
|
||||
[ENHANCEMENTS]
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ use Try::Tiny;
|
||||
use Module::Load ();
|
||||
use Path::Class 'dir';
|
||||
use NetAddr::IP::Lite ':lower';
|
||||
use List::Util qw/pairkeys pairfirst/;
|
||||
|
||||
use base 'Dancer::Object::Singleton';
|
||||
|
||||
@@ -131,6 +132,11 @@ sub _snmp_connect_generic {
|
||||
DebugSNMP => ($ENV{SNMP_TRACE} || 0),
|
||||
);
|
||||
|
||||
# an override for RemotePort
|
||||
($snmp_args{RemotePort}) =
|
||||
(pairkeys pairfirst { check_acl_no($device, $b) }
|
||||
%{setting('snmp_remoteport') || {}}) || 161;
|
||||
|
||||
# an override for bulkwalk
|
||||
$snmp_args{BulkWalk} = 0 if check_acl_no($device, 'bulkwalk_no');
|
||||
|
||||
|
||||
@@ -197,6 +197,7 @@ nonincreasing: false
|
||||
snmpver: 3
|
||||
snmptimeout: 3000000
|
||||
snmpretries: 2
|
||||
snmp_remoteport: {}
|
||||
devices_no: []
|
||||
devices_only: []
|
||||
timeout: 600
|
||||
|
||||
Reference in New Issue
Block a user