dump switch mac address in snmp format (without leading 0)
authorDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 17 Jul 2018 08:30:19 +0000 (10:30 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 17 Jul 2018 08:30:19 +0000 (10:30 +0200)
snmp-topology.pl

index 7aa4117..dd1e6d8 100755 (executable)
@@ -52,8 +52,10 @@ foreach my $file ( @dumps ) {
 #warn "# stat = ",dump($stat);
 
 open(my $fh, '>', '/dev/shm/mac2sw');
+open(my $fh2, '>', '/dev/shm/mac2sw.snmp');
 foreach my $mac ( keys %{ $stat->{_mac2sw} } ) {
        print $fh macfmt($mac), " ", $stat->{_mac2sw}->{$mac}, "\n";
+       print $fh $mac, " ", $stat->{_mac2sw}->{$mac}, "\n";
 };
 
 # XXX inject additional mac in filter to include wap devices