From ae8d11f9e6383cfd0adfed47343f53f330883d7c Mon Sep 17 00:00:00 2001 From: Kristian Lyngstol Date: Wed, 16 Mar 2016 22:09:57 +0000 Subject: NMS: Slightly better OID-list (not complete) --- clients/snmpfetchng.pl | 6 +++++- include/config.pm.dist | 23 ++++++++++++++++++++++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/clients/snmpfetchng.pl b/clients/snmpfetchng.pl index 5d1fd42..de8f802 100755 --- a/clients/snmpfetchng.pl +++ b/clients/snmpfetchng.pl @@ -103,7 +103,11 @@ sub inner_loop Community => $switch{'community'}, UseEnums => 1, Version => '2'); - $s->bulkwalk(0, 10, @nms::config::snmp_objects, sub{ callback(\%switch, @_); }); + my $ret = $s->bulkwalk(0, 10, @nms::config::snmp_objects, sub{ callback(\%switch, @_); }); + if (!defined($ret)) { + mylog("Fudge: ". $s->{'ErrorStr'}); + $outstanding--; + } } mylog( "Polling " . @switches . " switches: $poll_todo"); SNMP::MainLoop(5); diff --git a/include/config.pm.dist b/include/config.pm.dist index 382b4e2..492e02d 100755 --- a/include/config.pm.dist +++ b/include/config.pm.dist @@ -11,7 +11,28 @@ our $db_username = "nms"; our $db_password = ""; # NMS: What SNMP objects to fetch. -our @snmp_objects = [['ifTable'], ['ifXTable'], ['sysDescr'], ['sysName'],['ipForward']]; +# Some basics +our @snmp_objects = [ +['ifIndex'], +['sysNam'], +['sysDescr'], +['ifHighSpeed'], +['ifType'], +['ifName'], +['ifDescr'], +['ifAlias'], +['ifOperStatus'], +['ifAdminStatus'], +['ifLastChange'], +['ifHCInOctets'], +['ifHCOutOctets'], +['ifInDiscards'], +['ifOutDiscards'], +['ifInErrors'], +['ifOutErrors'], +['ifInUnknownProtos'], +['ifOutQLen'] +]; # Max SNMP polls to fire off at the same time. our $snmp_max = 20; -- cgit v1.2.3