Useful snmp OIDS

joel
2 min readDec 4, 2018
  1. interface name. 1.3.6.1.2.1.2.2.1.2

for examples:

snmpwalk -v2c -c public 192.168.0.1 1.3.6.1.2.1.2

will list all interface number with its name.

2. interface type. 1.3.6.1.2.1.2.2.1.3

this oid list interface type as an integer.

for examples:

6-ethernet

53–propVirtualproprietary vitural/internal interface

161-ieee8023adLagIEEE 802.3ad Link Aggregate(Trunk in hp switches)

see http://www.oid-info.com/get/1.3.6.1.2.1.2.2.1.3 for details

3. Interface Speed 1.3.6.1.2.1.2.2.1.5 in bits per second

4. If LastChange 1.3.6.1.2.1.2.2.1.9

Value of sysUpTime at the time the interface entered its current operational state.

this would be very useful for trouble shooting.

iso.3.6.1.2.1.2.2.1.9.1 = Timeticks: (2368025702) 274 days, 1:50:57.02
iso.3.6.1.2.1.2.2.1.9.2 = Timeticks: (7236) 0:01:12.36
iso.3.6.1.2.1.2.2.1.9.3 = Timeticks: (329081751) 38 days, 2:06:57.51
iso.3.6.1.2.1.2.2.1.9.4 = Timeticks: (366191869) 42 days, 9:11:58.69
iso.3.6.1.2.1.2.2.1.9.5 = Timeticks: (329195486) 38 days, 2:25:54.86
iso.3.6.1.2.1.2.2.1.9.6 = Timeticks: (4252827833) 492 days, 5:24:38.33
iso.3.6.1.2.1.2.2.1.9.7 = Timeticks: (4182556428) 484 days, 2:12:44.28
iso.3.6.1.2.1.2.2.1.9.8 = Timeticks: (2368023252) 274 days, 1:50:32.52

5. Show mac-address. 1.3.6.1.2.1.17.4.3.1.2

for example:

iso.3.6.1.2.1.17.4.3.1.2.0.3.71.112.54.77 = INTEGER: 290
iso.3.6.1.2.1.17.4.3.1.2.0.3.71.112.55.176 = INTEGER: 290
iso.3.6.1.2.1.17.4.3.1.2.0.8.202.249.236.232 = INTEGER: 290
iso.3.6.1.2.1.17.4.3.1.2.0.9.15.9.32.28 = INTEGER: 290
iso.3.6.1.2.1.17.4.3.1.2.0.10.94.77.53.149 = INTEGER: 290
iso.3.6.1.2.1.17.4.3.1.2.0.10.228.30.98.147 = INTEGER: 94
iso.3.6.1.2.1.17.4.3.1.2.0.10.228.30.99.37 = INTEGER: 180
iso.3.6.1.2.1.17.4.3.1.2.0.10.228.30.99.63 = INTEGER: 144

6. Vlan information. 1.3.6.1.2.1.17.7.1.4.3.1.1

iso.3.6.1.2.1.17.7.1.4.3.1.1.1 = STRING: “DFT”
iso.3.6.1.2.1.17.7.1.4.3.1.1.2 = STRING: “MGMT”

7. vlan tagged information. 1.3.111.2.802.1.1.4.1.4.2.1.5

8. vlan untagged information 1.3.111.2.802.1.1.4.1.4.2.1.6

iso.3.111.2.802.1.1.4.1.4.2.1.6.0.1.4092 = Hex-STRING: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00

for vlan 4092, non of unttagged. the hex string indicated unttaged port number. we can get it from interface number.

use the following code to extract hex value.

my_hex = ‘FFFD00C0000000000400000C000000000000FFFCFFDEFFEFDFFFFFFEF1FE00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000’

scale = 16

ss = bin(int(my_hex, scale))[2:]

p=1
for s in ss:

print(‘{0}:{1}’.format(p, s))
p+=1

9. Switch model. 1.3.6.1.2.1.47.1.1.1.1.2.1

modules inserted into the switch could be find by snmpwalk by oid 1.3.6.1.2.1.47.1.1.1.1.2

10. Read HP Switch slot Modules information. 1.3.6.1.4.1.11.2.14.11.1.2.3.1.4

11. Switch show flash information

a. list primary and secondary flash

$ snmpwalk -v 2c -c public x.x.x.x 1.3.6.1.4.1.11.2.14.11.5.1.59.1.3.1
iso.3.6.1.4.1.11.2.14.11.5.1.59.1.3.1.2.1 = Gauge32: 8533579
iso.3.6.1.4.1.11.2.14.11.5.1.59.1.3.1.2.2 = Gauge32: 15011924
iso.3.6.1.4.1.11.2.14.11.5.1.59.1.3.1.3.1 = STRING: “03/08/13”
iso.3.6.1.4.1.11.2.14.11.5.1.59.1.3.1.3.2 = STRING: “11/21/18”
iso.3.6.1.4.1.11.2.14.11.5.1.59.1.3.1.4.1 = STRING: “YA.15.12.0007”
iso.3.6.1.4.1.11.2.14.11.5.1.59.1.3.1.4.2 = STRING: “YA.16.08.0001”
iso.3.6.1.4.1.11.2.14.11.5.1.59.1.3.1.5.1 = STRING: “1173”
iso.3.6.1.4.1.11.2.14.11.5.1.59.1.3.1.5.2 = STRING: “264”

b. list the current running flash

$ snmpwalk -v 2c -c public x.x.x.x 1.3.6.1.4.1.11.2.14.11.5.1.59.1.4.1
iso.3.6.1.4.1.11.2.14.11.5.1.59.1.4.1.2.1 = INTEGER: 2
iso.3.6.1.4.1.11.2.14.11.5.1.59.1.4.1.3.1 = STRING: “/ws/swbuildm/YA_rel_knoxville_qaoff/code/build/lakes(swbuildm_YA_rel_knoxville_qaoff_rel_knoxville)”
iso.3.6.1.4.1.11.2.14.11.5.1.59.1.4.1.4.1 = STRING: “Mar 8 2013 15:37:47”
iso.3.6.1.4.1.11.2.14.11.5.1.59.1.4.1.5.1 = STRING: “YA.15.12.0007”
iso.3.6.1.4.1.11.2.14.11.5.1.59.1.4.1.6.1 = STRING: “1173”
iso.3.6.1.4.1.11.2.14.11.5.1.59.1.4.1.7.1 = INTEGER: 2
iso.3.6.1.4.1.11.2.14.11.5.1.59.1.4.1.8.1 = INTEGER: 1
iso.3.6.1.4.1.11.2.14.11.5.1.59.1.4.1.9.1 = INTEGER: 1

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

No responses yet

Write a response