SNMP query examples

From techdocs
Revision as of 15:56, 24 Haziran 2022 by Plinich (talk | contribs) (Created page with "=== Querying the interface table === Two queries shown here. One “walks” the whole interface table (see the relevant RFC‘s), and the other “gets” two particular values — in this case they are the receive and transmit byte counts for “eth0”. Also see <code># cat /sys/class/net/eth0/ifindex</code>. root@nw-syd-monitor1:/usr/share/snmp/mibs# '''snmpwalk -v 1 -c csereader nw-syd-vx1 iso.3.6.1.2.1.2''' iso.3.6.1.2.1.2.1.0 = INTEGER: 2 iso.3.6.1.2.1.2.2.1...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Querying the interface table

Two queries shown here. One “walks” the whole interface table (see the relevant RFC‘s), and the other “gets” two particular values — in this case they are the receive and transmit byte counts for “eth0”.

Also see # cat /sys/class/net/eth0/ifindex.

root@nw-syd-monitor1:/usr/share/snmp/mibs# snmpwalk -v 1 -c csereader nw-syd-vx1 iso.3.6.1.2.1.2
iso.3.6.1.2.1.2.1.0 = INTEGER: 2
iso.3.6.1.2.1.2.2.1.1.1 = INTEGER: 1
iso.3.6.1.2.1.2.2.1.1.2 = INTEGER: 2
iso.3.6.1.2.1.2.2.1.2.1 = STRING: "lo"
iso.3.6.1.2.1.2.2.1.2.2 = STRING: "Amazon.com, Inc. Elastic Network Adapter (ENA)"
iso.3.6.1.2.1.2.2.1.3.1 = INTEGER: 24
iso.3.6.1.2.1.2.2.1.3.2 = INTEGER: 6
iso.3.6.1.2.1.2.2.1.4.1 = INTEGER: 65536
iso.3.6.1.2.1.2.2.1.4.2 = INTEGER: 9001
iso.3.6.1.2.1.2.2.1.5.1 = Gauge32: 10000000
iso.3.6.1.2.1.2.2.1.5.2 = Gauge32: 0
iso.3.6.1.2.1.2.2.1.6.1 = ""
iso.3.6.1.2.1.2.2.1.6.2 = Hex-STRING: 0A 9A 00 7F 8B 8E 
iso.3.6.1.2.1.2.2.1.7.1 = INTEGER: 1
iso.3.6.1.2.1.2.2.1.7.2 = INTEGER: 1
iso.3.6.1.2.1.2.2.1.8.1 = INTEGER: 1
iso.3.6.1.2.1.2.2.1.8.2 = INTEGER: 1
iso.3.6.1.2.1.2.2.1.9.1 = Timeticks: (0) 0:00:00.00
iso.3.6.1.2.1.2.2.1.9.2 = Timeticks: (0) 0:00:00.00
iso.3.6.1.2.1.2.2.1.10.1 = Counter32: 43960
iso.3.6.1.2.1.2.2.1.10.2 = Counter32: 7690863
iso.3.6.1.2.1.2.2.1.11.1 = Counter32: 676
iso.3.6.1.2.1.2.2.1.11.2 = Counter32: 72149
iso.3.6.1.2.1.2.2.1.12.1 = Counter32: 0
iso.3.6.1.2.1.2.2.1.12.2 = Counter32: 0
iso.3.6.1.2.1.2.2.1.13.1 = Counter32: 0
iso.3.6.1.2.1.2.2.1.13.2 = Counter32: 0
iso.3.6.1.2.1.2.2.1.14.1 = Counter32: 0
iso.3.6.1.2.1.2.2.1.14.2 = Counter32: 0
iso.3.6.1.2.1.2.2.1.15.1 = Counter32: 0
iso.3.6.1.2.1.2.2.1.15.2 = Counter32: 0
iso.3.6.1.2.1.2.2.1.16.1 = Counter32: 43960
iso.3.6.1.2.1.2.2.1.16.2 = Counter32: 9110683
iso.3.6.1.2.1.2.2.1.17.1 = Counter32: 676
iso.3.6.1.2.1.2.2.1.17.2 = Counter32: 72813
iso.3.6.1.2.1.2.2.1.18.1 = Counter32: 0
iso.3.6.1.2.1.2.2.1.18.2 = Counter32: 0
iso.3.6.1.2.1.2.2.1.19.1 = Counter32: 0
iso.3.6.1.2.1.2.2.1.19.2 = Counter32: 0
iso.3.6.1.2.1.2.2.1.20.1 = Counter32: 0
iso.3.6.1.2.1.2.2.1.20.2 = Counter32: 0
iso.3.6.1.2.1.2.2.1.21.1 = Gauge32: 0
iso.3.6.1.2.1.2.2.1.21.2 = Gauge32: 0
iso.3.6.1.2.1.2.2.1.22.1 = OID: ccitt.0
iso.3.6.1.2.1.2.2.1.22.2 = OID: ccitt.0
root@nw-syd-monitor1:/usr/share/snmp/mibs# snmpget -v 1 -c csereader nw-syd-vx1 iso.3.6.1.2.1.2.2.1.10.2 iso.3.6.1.2.1.2.2.1.16.2
iso.3.6.1.2.1.2.2.1.10.2 = Counter32: 7695399
iso.3.6.1.2.1.2.2.1.16.2 = Counter32: 9115574
root@nw-syd-monitor1:/usr/share/snmp/mibs#