Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm, trying to get mac addresses from switches in a network. For that i'm using snmp calls with these oids: (like in this manual) .1.3.6.1.2.1.17.4.3.1.1, .1.3.6.1.2.1.17.4.3.1.2. But i have a problem with Raisecom ISCOM device: it seems not to support this oids.

Another problem is that Raisecom doesn't answer for snmp -c community@vlan... prompt - only without vlan.

So, my question is: how can i get this mac addresses and how to manage with vlans?

share|improve this question
add comment

1 Answer

try this small bash script to get mac - port - vlan $1 - is community $2 - is ip address/hostname

#!/bin/bash
snmpwalk -Cc  -Onq -v 2c -c $1 $2 .1.3.6.1.2.1.17.7.1.2.2.1.2 |(
 while read line ; do 
echo $line | awk '{print $1}' | awk -F. '{printf("%02x%02x%02x%02x%02x%02x\t",$16,$17,$18,$19,$20,$21)}'
echo $line | awk '{printf("%u\t",$2)}' 
echo $line | awk '{print $1}' | awk -F. '{print $15}'
done)
exit 0
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.