Skip to content

SNMP monitoring

An object identifier (OID) represents the data points where the data for the graphs comes from. Sometimes the reason that a graph is not appearing is because the OID for the particular graph is not valid for the device. You can test this validity using the command line to see if you can return a value. To test the validity of an OID data point giving performance data:

  1. Log in to a host with network access to the target device. By default, SNMP uses UDP 161.

  2. If the snmpget and snmpwalk utilities are not available, you may need to install them. Check the documentation for your operating system.

  3. Run the snmpget command for one of the OIDs. For example, for a server named SERVER, running SNMP version 2c, and with a community string of public, enter the following command:

    snmpget -v 2c -c public SERVER .1.3.6.1.4.1.2021.4.14.0
    

    If the OID is valid, the snmpget command returns a value.

Basic SNMP commands

Here are some basic SNMP commands to gather certain information.

  • Get a single value.

    snmpget -v 2c -cpublic <device_name_or_ip_address> ifDescr.2
    
  • Walk a basic system MIB.

    snmpwalk -v 2c -cpublic <device_name_or_ip_address> system
    
  • Walk an interface description.

    snmpwalk -v 2c -cpublic <device_name_or_ip_address> ifDescr
    
  • Detailed description of an OID value.

    snmptranslate -Td RFC1213-MIB::ifDescr
    
  • Convert a name to a raw OID.

    snmptranslate -On RFC1213-MIB::ifDescr
    
  • Convert a raw OID to a short name.

    snmptranslate -OS .1.3.6.1.2.1.2.2.1.2