Querying Cat3750 for certain data

Answered Question
Jan 22nd, 2008

Hi,

Could you please tell me what SNMP OIDs should I query on Cat3750 to obtain following informations (if available at all):

* The name of the switch

I believe this one is 1.3.6.1.4.1.9.2.1.3.0

* The MAC address of the port

* The number of bytes sent from the client since the last switch reset

* The number of bytes sent to the client since the last switch reset

* The date of the last switch reset

* The current timestamp from the switch

Where and how to search for OIDs with concrete data? I've done some research with limited success on following sites:

http://tools.cisco.com/Support/SNMP/do/SearchOID.do?local=en&step=1

http://www.mibdepot.com/

and using snmpwalk on device.

Thanks in advance,

Best regards,

Marcin Al-Jawahiri

I have this problem too.
0 votes
Correct Answer by Joe Clarke about 8 years 10 months ago

Actually, what might be easier for you is to use ifPhysAddress from the IF-MIB. This object is indexed by ifIndex just like the Octets objects, so you would not need to do any additional mapping.

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (3 ratings)
Loading.
Joe Clarke Tue, 01/22/2008 - 11:32

For the switch name you can use sysName or 1.3.6.1.2.1.1.5.

For the MAC address of the port, you will want to use the BRIDGE-MIB and the dot1dTpFdbTable. Ports with a dot1dTpFdbStatus of self(4) are actually the MAC of the switchport itself.

Byte counts can be obtained using ifInOctets and ifOutOctets (or better yet, ifHCInOctets and ifHCOutOctets). The In counters will tell you bytes sent from the attached host, and the Out counters will tell you bytes sent to the attached host.

sysUpTime will tell you how long the switch has been online. This object is of type Timeticks which is in 1/100s of a second. You will need to work backwards to obtain the date at which it was rebooted.

The current time of the switch is not available via SNMP.

You can use the Search & Translate tool at http://jaguar.ir.miami.ed/~marcus/snmptrans.html to search through MIB object names and descriptions (including regular expressions) for matching strings.

themartinez Wed, 01/23/2008 - 02:33

Thank you, you were very helpful. Forgive my ignorance but MAC address part is still unclear for me. Given VLAN OID of the port (e.g. 1.3.6.1.4.1.9.9.68.1.2.2.1.2.101) how can I obtain its MAC address? For in/out byte count it seems to be easy because I can see corresponding OIDs so I believe that VLAN OID 1.3.6.1.4.1.9.9.68.1.2.2.1.2.101 corresponds to ifIn counter 1.3.6.1.2.1.2.2.1.10.101 (ifInOctets.10101) OID. Or is my observation flawed and I'm not guaranteed such a correspondence exists? However with MAC address I don't see any corresponding OIDs at all. Is it actually possible to retrieve MAC address of the port given its VLAN OID? If yes how can I get it? If no what should I actually be given as an query input and how to use it to retrieve MAC address? (I'm using snmpget/snmpwalk and SNMP4J for data retrieval)

Thanks in advance,

Best regards,

Marcin Al-Jawahiri

Joe Clarke Wed, 01/23/2008 - 10:33

This is not possible. The MAC addresses of ports are indexed by the dot1dBasePort and not ifIndex (like the Octet objects). To map those MACs back to an ifIndex, you need to use dot1dBasePortIfIndex. This tech tip will give you more information. It talks about finding MAC addresses attached to switch ports, but the same principle applies to finding the MAC addresses of switch ports.

http://www.cisco.com/en/US/tech/tk648/tk362/technologies_tech_note09186a0080094a9b.shtml

Correct Answer
Joe Clarke Wed, 01/23/2008 - 10:37

Actually, what might be easier for you is to use ifPhysAddress from the IF-MIB. This object is indexed by ifIndex just like the Octets objects, so you would not need to do any additional mapping.

Actions

This Discussion