Using the SNMP Utilities
4.1 Using the MIB Browser
$ snmp_request marley.dec.com "public" get 1.3.6.1.2.1.2.2.1.2.1 -
_$ 1.3.6.1.2.1.25.1.1.0
1.3.6.1.2.1.2.2.1.2.1 = LO IP Interface: LO0, OpenVMS Adapter: <none>,
Loopback Port
1.3.6.1.2.1.25.1.1.0 = 6024942 = 0 d 16:44:9
3. The following example shows how to retrieve the next MIB II variable. This
is similar to the command in example 1, except that a
GetNext
request is
issued and
sysObjectID.0
(1.3.6.1.2.1.1.2.0) is returned.
$ snmp_request marley.dec.com "public" getnext 1.3.6.1.2.1.1.1.0
1.3.6.1.2.1.1.2.0 = 1.3.6.1.4.1.36.2.15.13.7.1
4. The following example shows how to use the SNMP Version 2
GetBulk
request to retrieve the MIB II variables
sysUpTime.0
(1.3.6.1.2.1.1.1.0) and
sysDescr.0
(1.3.6.1.2.1.1.2.0), and for the first three interfaces, the values of
ifDescr
(OIDs with the prefix 1.3.6.1.2.1.2.2.1.2) and
ifType
(OIDs with the
prefix 1.3.6.1.2.1.2.2.1.3).
$ snmp_request marley.dec.com "public" getbulk -n 2 -m 3 -
_$ 1.3.6.1.2.1.1.1 1.3.6.1.2.1.1.2 -
_$ 1.3.6.1.2.1.2.2.1.1 1.3.6.1.2.1.2.2.1.2 1.3.6.1.2.1.2.2.1.3
Warning: using version SNMPv2 for getbulk command.
1.3.6.1.2.1.1.1.0 = marley.dec.com AlphaStation 255/300
OpenVMS V7.1 Digital TCP/IP Services for OpenVMS
1.3.6.1.2.1.1.2.0 = 1.3.6.1.4.1.36.2.15.13.7.1
1.3.6.1.2.1.2.2.1.1.1 = 1
1.3.6.1.2.1.2.2.1.2.1 = LO IP Interface: LO0, OpenVMS Adapter: <none>,
Loopback Port
1.3.6.1.2.1.2.2.1.3.1 = 24
1.3.6.1.2.1.2.2.1.1.3 = 3
1.3.6.1.2.1.2.2.1.2.3 = WE IP Interface: WE0, OpenVMS Adapter: EWA0:,
PCI bus Ethernet Adapter
1.3.6.1.2.1.2.2.1.3.3 = 6
1.3.6.1.2.1.2.2.1.1.4 = 4
1.3.6.1.2.1.2.2.1.2.4 = WF IP Interface: WF0, OpenVMS Adapter: FWA0:,
DEFPA PCI bus FDDI Adapter
1.3.6.1.2.1.2.2.1.3.4 = 15
5. The following example shows how to use the
GetNext
request with the
-l
(loop) flag to retrieve all OIDs starting at the first instance after the OID
input and finishing at the end of the MIB view. Note that if an SNMP
Version 2 agent is the server, the results using
getbulk
are identical (in
general, SNMP Version 1 agents do not support
getbulk
requests).
$ snmp_request marley.dec.com "public" getnext -l 1.3.6.1.2.1.1.1.0
1.3.6.1.2.1.1.2.0 = 1.3.6.1.4.1.36.2.15.13.7.1
1.3.6.1.2.1.1.3.0 = 1280260 = 0 d 3:33:22
1.3.6.1.2.1.1.4.0 = Sam Spade
1.3.6.1.2.1.1.5.0 = marley.dec.com
1.3.6.1.2.1.1.6.0 = Falcon BuildingLos Angeles, CA
1.3.6.1.2.1.1.7.0 = 72
1.3.6.1.2.1.1.8.0 = 0 = 0 d 0:0:0
.
.
.
1.3.6.1.2.1.25.5.1.1.2.294 = 560
1.3.6.1.2.1.25.5.1.1.2.295 = 472
1.3.6.1.6.3.1.1.6.1.0 = 1296505215
- no such name - returned for variable 1
Using the SNMP Utilities 4–7