From 382b39f4befbf9899dd26866ccebd1774b7f0554 Mon Sep 17 00:00:00 2001 From: hjp Date: Thu, 19 Oct 2006 14:19:02 +0000 Subject: [PATCH] Adapted to NET-SNMP version: 5.2.3 --- snmp/mac-port | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/snmp/mac-port b/snmp/mac-port index c20ad21..16583d7 100755 --- a/snmp/mac-port +++ b/snmp/mac-port @@ -1,6 +1,6 @@ #!/usr/bin/perl -w # -# $Id: mac-port,v 1.1 2001-04-11 14:31:29 hjp Exp $ +# $Id: mac-port,v 1.2 2006-10-19 14:19:02 hjp Exp $ # # find the port of a baystack 350 T switch to which a given # mac address is connected. @@ -21,11 +21,16 @@ my $switch = $ARGV[0]; my @dmac = map { hex } @hmac; -my $object = "17.4.3.1.2." . join(".", @dmac); +my $object = "SNMPv2-SMI::mib-2.17.4.3.1.2." . join(".", @dmac); -system("snmpget", $switch, "public", $object); +# snmpget -v 1 -c public 143.130.49.11 SNMPv2-SMI::mib-2.17.4.3.1.2.0.22.212.55.173.185 + +system("snmpget", "-v", "1", "-c", "public", $switch, $object); # $Log: mac-port,v $ -# Revision 1.1 2001-04-11 14:31:29 hjp +# Revision 1.2 2006-10-19 14:19:02 hjp +# Adapted to NET-SNMP version: 5.2.3 +# +# Revision 1.1 2001/04/11 14:31:29 hjp # mac-port: convert mac address to switch port using snmp. #