
Int port = int.Parse(v.Value.ToString()) - (52 * (dellSwitch - 1))

Int dellSwitch = 1 + int.Parse(v.Value.ToString()) / 52

You need to know these values to correctly iterate through a stack of switches. agent reported an error with the requestĬonsole.WriteLine("Error in SNMP reply. the Agent - see SnmpConstants for error definitions ErrorStatus other then 0 is an error returned by If result is null then agent didn't reply or we couldn't parse the reply. You should catch exceptions in the Request if using in real application. SnmpV1Packet result = (SnmpV1Packet)target.Request(pdu, param) Initialize request PDU with the last retrieved Oid that needs to be incremented on subsequent requests made using the When Pdu class is first constructed, RequestId is set to a random value This Oid represents last Oid returned by the SNMP agent Define Oid that is the root of the MIB tree you wish to retrieve OctetString community = new OctetString(snmpCommunity) ĪgentParameters param = new AgentParameters(community) Private void SnmpWalk(IPAddress ip, string snmpCommunity, string oid, string switchNum) Ports will be labeled SwitchNum/Stack Number/Port Numbers.

SNMPWALK the ports on a switch or stack of switches.
SNMP WALK TOOL FOR MAC MAC
Here's an example that will create a list of all the MAC Addresses and Ports on a particular Dell Switch using the OID 1.3.6.1.2.1.17.7.1.2.2.1.2.1 using SnmpSharpNet
SNMP WALK TOOL FOR MAC WINDOWS
If any one you would like to do this programmatically from a Windows Server you can use the SnmpSharpNet library to accomplish the same thing. *= rack models: cisco 2900xl, foundry FI4802 + variants

