JunOS | Find SNMP OID
Updated: Apr 13, 2020
Simple Network Management Protocol (SNMP) is an application–layer protocol for exchanging management information between network devices. It is a part of Transmission Control Protocol⁄Internet Protocol (TCP⁄IP) protocol suite
Now the real question…how to find the SNMP OID corresponds to SNMP Object name in Junos?
Let's say we have to check the OID corresponding to BGP AS, just type:
If you want to see all of them, type:
...there will be close to 60,000 entries:
Let's focus back on BGP AS:
I can see one of the output is "bgpLocalAs.0" which is I am after, so lets see how we can get the OID corresponding to it:
Here it is , so we got the OID and you can use this OID in NMS systems to poll this specific object.
=== Another example - TCP Connection ===
Let’s find OID related to TCP connection:
To find the decimal OID number for TCP connection state:
We have found the MIB number for TCP connection state which is22.214.171.124.126.96.36.199.1.1. Now if you walk it, you’ll get the same results:
tcpConnState.0.0.0.0.188.8.131.52.0.0 is ascii representation for 184.108.40.206.220.127.116.11.18.104.22.168.0.0.22.0.0.0.0.0
22.214.171.124.126.96.36.199.188.8.131.52.0.0.22.0.0.0.0.0 equals to 2 as per tcpConnState.0.0.0.0.184.108.40.206.0.0 = 2
Enumeration: 1-closed, 2-listen, 3-synSent, 4-synReceived, 5-established, 6-finWait1, 7-finWait2, 8-closeWait, 9-lastAck, 10-closing, 11-timeWait and 12-deleteTCB.
From the note above we can tell that 2 is the state of the connection. This means that the device is listening on port 22 where first 0.0.0.0 is Local Address, last 0.0.0.0 is the RemoteAddress and the last 0 is the port for Remote Address.