diff options
-rwxr-xr-x | collectors/snmpfetchng.pl | 5 | ||||
-rwxr-xr-x | include/config.pm | 1 | ||||
-rwxr-xr-x | include/nms.pm | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/collectors/snmpfetchng.pl b/collectors/snmpfetchng.pl index 060ce2d..566e48c 100755 --- a/collectors/snmpfetchng.pl +++ b/collectors/snmpfetchng.pl @@ -7,7 +7,7 @@ use POSIX; use SNMP; use Data::Dumper; use lib '/opt/gondul/include'; -use nms; +use nms qw(convert_mac); SNMP::initMib(); SNMP::addMibDirs("/opt/gondul/mibs/StandardMibs"); @@ -68,7 +68,6 @@ sub populate_switches if (!defined($ip) or $ip eq "") { $ip = 'udp6:[' . $ref->{'ip2'} . ']'; } - print "Ip: $ip\n"; push @switches, { 'sysname' => $ref->{'sysname'}, 'id' => $ref->{'switch'}, @@ -118,7 +117,7 @@ sub callback{ $total++; my ($tag,$type,$name,$iid, $val) = ( $inner->tag ,$inner->type , $inner->name, $inner->iid, $inner->val); if ($tag eq "ifPhysAddress") { - next; + $val = convert_mac($val); } $tree{$iid}{$tag} = $val; if ($tag eq "ifIndex") { diff --git a/include/config.pm b/include/config.pm index 9987d05..c8664cb 100755 --- a/include/config.pm +++ b/include/config.pm @@ -25,6 +25,7 @@ our @snmp_objects = [ ['ifOperStatus'], ['ifAdminStatus'], ['ifLastChange'], + ['ifPhysAddress'], ['ifHCInOctets'], ['ifHCOutOctets'], ['ifInDiscards'], diff --git a/include/nms.pm b/include/nms.pm index df4cc3a..eff61c3 100755 --- a/include/nms.pm +++ b/include/nms.pm @@ -8,7 +8,7 @@ use JSON; package nms; use base 'Exporter'; -our @EXPORT = qw(db_connect); +our @EXPORT = qw(db_connect convert_mac); BEGIN { require "config.pm"; |