Run Snmpwalk from an NMS System to a Juniper Router
Purpose
Snmpwalk is an SNMP application that you can use to query a MIB for information about the functioning of a router in your network. Snmpwalk uses
GetNextrequests to retrieve the specified information. Object identifiers (OIDs) are used to query the MIB. If the OID argument is not present, Snmpwalk searches MIB-2.Action
To run Snmpwalk for a specific OID, from a management station that has access to the router, and using a tool such as Snmpwalk, enter the following command:
user-nms#snmpwalk[common arguments]hostname community object-idSample Output
user-nms %snmpwalk -Os -M /volume/~/mibs -m all tp1 public .1.3.6.1.2.1.4ipForwarding.0 = forwarding(1)ipDefaultTTL.0 = 64ipInReceives.0 = Counter32: 9262713ipInHdrErrors.0 = Counter32: 0ipInAddrErrors.0 = Counter32: 0ipForwDatagrams.0 = Counter32: 614171ipInUnknownProtos.0 = Counter32: 0ipInDiscards.0 = Counter32: 0ipInDelivers.0 = Counter32: 8648408ipOutRequests.0 = Counter32: 1226483ipOutDiscards.0 = Counter32: 0ipOutNoRoutes.0 = Counter32: 0ipReasmTimeout.0 = 60ipReasmReqds.0 = Counter32: 0ipReasmOKs.0 = Counter32: 0ipReasmFails.0 = Counter32: 0ipFragOKs.0 = Counter32: 0ipFragFails.0 = Counter32: 0ipFragCreates.0 = Counter32: 0ipAdEntAddr.10.0.0.1 = IpAddress: 10.0.0.1ipAdEntAddr.10.1.12.1 = IpAddress: 10.1.12.1ipAdEntAddr.10.1.15.1 = IpAddress: 10.1.15.1ipAdEntAddr.10.168.70.143 = IpAddress: 10.168.70.143[...Output truncated...]What It Means
The sample output shows that the user is on a network management station (
user-nms %) that has access to the router,tp1. In the command, the following options are used:
Os—Deletes all but the last symbolic part of the OIDsysUpTime.0. For example,Timeticks: (14096763) 1 day, 15:09:27.63.-M—Compiles the MIB and gives a path or location to the MIBs.-m—Uses the files in the directory pointed to by the-Moption.all—Uses all the files in the directory pointed to by the-Moption.In addition, the command includes the hostname
tp1, the community stringpublic, and the OID.1.3.6.1.2.1.4.The OID in this example is from RFC 2096, IP Forwarding Table MIB, which displays multipath IP routes that have the same network number but different network masks.
Before you can retrieve SNMP information from a router, you must have the minimum SNMP configuration for that router. Following is the minimum SNMP configuration required:
[edit]snmp {community public {authorization read-only;}}With this configuration, the system responds to SNMP
Get,GetNext, andGetBulkcommands that contain the community stringpublic.For more detailed information on configuring SNMP on a router, see the JUNOS Network Management Configuration Guide.