use just right part of table
[dell-switch] / snmp-mac-port
index b49f7e3..db0e0bf 100755 (executable)
@@ -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