2

I am trying to write a simple program that displays the front panel of cisco devices remotely (in this case a 3560 switch). So I need to read the status of each port via snmp and turn on the LED on my GUI accordingly. After some search I came to use the "ifOperStatus" with OID 1.3.6.1.2.1.2.2.1.8.

But the problem is that this OID returns "1:up" as soon as a cable is plugged into the port and does not reflect the different status the port might have including:

Blinking green: Link has activity

Solid amber: Port is faulty

etc,

Any clue or hint on which OIDs I should use?

2
  • See Also: CISCO-IF-EXTENSION-MIB
    – Ricky
    Commented Aug 23, 2015 at 21:03
  • Did any answer help you? if so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could provide and accept your own answer.
    – Ron Maupin
    Commented Aug 7, 2017 at 19:07

3 Answers 3

2

Have you looked at this OID ?

Specific Object Information 
Object  clsPortLedStatus
OID 1.3.6.1.4.1.9.5.11.1.7.1.1.3
Type    INTEGER
Permission  read-only
Status  current
Values  1 : unknown
2 : on
3 : off
MIB CISCO-RHINO-MIB 
Description "Indicates the status of the LED.
Unknown(1) indicates either the LED status is 
not supported or the status is none of the
defined."

And the related :

Specific Object Information 
Object  clsPortLedType
OID 1.3.6.1.4.1.9.5.11.1.7.1.1.2
Type    INTEGER
Permission  read-only
Status  current
Values  1 : ledTx
2 : ledRx
3 : ledLink
4 : led100Mbps
5 : ledRxLoss
6 : ledRxFullOut
7 : ledRxSync
8 : ledFullDuplex
9 : ledOptDetect

Unfortunately the supported images/platforms are very limited : http://tools.cisco.com/ITDIT/MIBS/AdvancedSearch?MibSel=4682

I would say fake it, for link activity. Poll interface stats (bytes or frames or packets in or out) and make the light in your application blink as long as either is increasing.
(Though I suppose technically some control traffic might or might not cause the physical LED to blink - for example, do BPDUs alone count towards link activity ? I do not know - I can check later, if you'd like.)

I searched and browsed the SNMP Object Navigator (http://tools.cisco.com/Support/SNMP/do/BrowseOID.do?local=en) last night for you, but found nothing suitable (not to say it doesn't exist), and any potentially interesting ones were marked as inaccessible ("Permission not-accessible").

If you're feeling especially crafty, and want the utmost accuracy, you could probably setup an ambient light sensor / "light to frequency converter" in front of each crucial port LED, and code to have that info passed to your application.
But that's not scalable, so it's probably easier to fake it.

EDIT, ROUND 2 !

How about :

"This object is used to indicate the current color of a LED."

Object  c2900PortVisualIndicator
OID 1.3.6.1.4.1.9.9.87.1.4.1.1.24
Type    INTEGER
Permission  read-only
Status  current
Values  1 : notused
2 : black
3 : amber
4 : green
MIB CISCO-C2900-MIB
Description "This object is used to indicate the current color of
a LED. If a LED is flashing, the value of this object will
represent the color of the LED at that instant in time.
The following conventions indicate port status:
Link healthy returns green(4)
Link activity usually green(4), but may return black(2).
Link faulty alternating green(4)/amber(3)
Port disabled returns amber(3)"

"The color of the LED."

Object  ceExtEntityLEDColor
OID 1.3.6.1.4.1.9.9.195.1.3.1.2
Type    INTEGER
Permission  read-only
Status  mandatory
Values  1 : off
2 : green
3 : amber
4 : red
MIB CISCO-ENTITY-EXT-MIB-V1SMI
Description The color of the LED.

"An integer value that describes the color of the display"

Type    CDisplayColor
Status  current
Values  1 : unknown
2 : white
3 : red
4 : green
5 : yellow
6 : amber
7 : blue
8 : greenAndAmber
MIB CISCO-ENTITY-DISPLAY-MIB
Description "An integer value that describes the color of the display.

'greenAndAmber' - Indicates that the display color toggles between green and amber."

As well as,
mrStackUnitBasePortVisualIndicatorGreenMap,
mrStackUnitBasePortVisualIndicatorAmberMap,
mrStackUnitExpansionPortVisualIndicatorGreenMap,
mrStackUnitExpansionPortVisualIndicatorAmberMap, and
mrStackUnitActivityVisualIndicator

all under mrStackUnitEntry.

For ATM :
ciscoAtmIfXmitLed
ciscoAtmIfRecvLed
ciscoAtmIfCdLed

Finally, this nugget, from "CISCO-WIRELESS-EXP-MIB" :
"When the CISCO-LED-MIB.my becomes available and supports the functionality the LED group needs, the LED group will be migrated into that."

Apparently mention of a MIB that never came to be.

4
  • Thanks a lot for your time. I will test the OIDs you suggested.
    – ae41
    Commented Aug 25, 2015 at 4:08
  • ... But from the first look at the description of the OIDs you proposed, it seems they dont report the "faulty" state that causes the port's LED to turn "amber". Besides SNMP is there any other cmd, etc. that would allow me to read the port's faulty status. Regarding the Blinking: first of all any activity on the interface (even BPDUs) will cause the LED to blink. As you suggested I can use ifInOctet and ifOutOctet to sense link activity and simulate blinking in my program
    – ae41
    Commented Aug 25, 2015 at 4:18
  • @ae41 Updated ! ... This may be the best I can do for you.
    – robut
    Commented Aug 25, 2015 at 20:26
  • @ae41, an amber port is not faulty, it is blocked by spanning-tree. On a 3560, a solid amber port indicates Port is blocked by Spanning Tree Protocol (STP) and is not forwarding data. That is not a faulty port, that is a port functioning as it should to save you from STP loops and broadcast storms.
    – Ron Maupin
    Commented Aug 25, 2015 at 21:46
1

This is an older Cisco page that I wished was kept current. Has many of the Cisco products but not always the latest and greatest. http://www.cisco.com/public/sw-center/netmgmt/cmtk/mibs.shtml

One thing to keep in mind that I haven't seen mention is you can go through the entire Cisco mib universe but if the mib you are wanting to use isn't installed in the IOS that the switch running you will only be spinning your wheels.

For example you mention the 3560 model. If you had 12.2.50 train of code this is the supported mibs. ftp://ftp.cisco.com/pub/mibs/supportlists/cat3560/cat3560-supportlist.htm

If you had 15.x code train then the mibs will be a different mix. You have to look up the release notes/data sheets for each code build if you are going to deep dive into off beat mibs. The standards based and Cisco generic mibs are generally always in the vast majority of the code trains.

Been there, done that with scripts trying to extract specific OID's to only later discover that the mib isn't in the switch. Really problematic for DHCP stats and environmental stats.

Also are you wanting the GUI to show blinking lights? snmp queries are snapshots in time depending on the OID queried. If your wanting to keep up with the constant state of the lights then you will be polling non stop which will drive the cpu to 100% and stay there. Not that hard to drive a 3560 cpu into the ground from personal experiences with snmp polling.

Just some things to keep in mind.

Good luck.

4
  • Thanks for the answer. 1st of all opening the FTP site you had suggested fails (asking for username/password that I dont have) How can I get access to cisco's ftp site (how can I get userpass)? BTW, the amber status is more important to me as it indicates a problem. Regarding the activity: i can read pktin/out counts periodically and only when the front panel view is ON, imitate link activity correspondingly in between the polling periods, But blinking is not that important to me for now
    – ae41
    Commented Aug 27, 2015 at 5:10
  • The link it to Cisco's public server that doesn't require a password. I tried it in a browser on a different pc that I don't ever use and it opened right up. Not sure what to tell you.
    – bsulli
    Commented Aug 27, 2015 at 13:10
  • @ae41, an amber light on a 3560 does not indicate a problem as you keep saying. The 3560 installation guide says that it is a port blocked by STP. That is a good thing, not a problem.
    – Ron Maupin
    Commented Aug 27, 2015 at 14:43
  • beg to differ if the tech I dispatched fat fingered VTP config and entire wing of a high school is down and I have to drive out and clean up the mess. Been there deal with that. Really not sure what you are trying to accomplish with the project but I wish you good luck and success.
    – bsulli
    Commented Aug 27, 2015 at 14:46
0

IF-MIB and CISCO-IF-EXTENSION-MIB (and OLD-CISCO-INTERFACE-MIB) will contain 99.999% of everything you can get via SNMP. In short, there's no OID to give you the LED state of the switch. However, you can retrieve numerous OIDs to figure it out.

(Fetch dashboard.shtml from one of your switches if you want to see how Cisco's Device Manager does it. You will not be impressed.)

1
  • Hi, I have checked the IF_MIB and it does not help me. But i couldn't get access to CISCO-IF-EXTENSION-MIB; could u tell me where i might download it
    – ae41
    Commented Aug 25, 2015 at 4:32

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