X-Git-Url: http://git.rot13.org/?p=dell-switch;a=blobdiff_plain;f=snmp-mac-port;h=db0e0bf7ac8e6d79c0cdb576777a20739fde3d24;hp=b49f7e3e1ea0b5c3f34bfd69f0b9491d5e8a57b2;hb=ae2751ac9d0d808cd656146abaf788fae25feb4e;hpb=3edd0b0dcdb005b820d13018df04977f85f72cdb diff --git a/snmp-mac-port b/snmp-mac-port index b49f7e3..db0e0bf 100755 --- a/snmp-mac-port +++ b/snmp-mac-port @@ -9,7 +9,7 @@ snmp_walk() { ip=$1 #snmpwalk -O0sUX -v2c -Cc -c $COMMUNITY $ip BRIDGE-MIB::dot1dTpFdbPort | sed -e "s/^[^:]*:/$ip/" -e 's/\].*: / /' | tee $log/$ip # Q-BRIDGE-MIB dot1qFdbTable - snmpwalk -O0sUX -v2c -Cc -c $COMMUNITY $ip 1.3.6.1.2.1.17.7.1.2.2 | sed -e 's/.*7\.1\.2\.2\.[0-9]\.[0-9]\.//' -e 's/ = [^:]*: / /' -e 's/\./ /g' | awk -v name=$ip '{ printf "%s %d %02x:%02x:%02x:%02x:%02x:%02x %d\n", name, $1, $2,$3,$4,$5,$6,$7, $8 }' | tee $log/$ip + snmpbulkwalk -O0sUX -v2c -Cc -c $COMMUNITY $ip 1.3.6.1.2.1.17.7.1.2.2.1.2 | sed -e 's/.*7\.1\.2\.2\.[0-9]\.[0-9]\.//' -e 's/ = [^:]*: / /' -e 's/\./ /g' | awk -v name=$ip '{ printf "%s %d %02x:%02x:%02x:%02x:%02x:%02x %d\n", name, $1, $2,$3,$4,$5,$6,$7, $8 }' | tee $log/$ip } if [ ! -z "$1" ] ; then