LinuxCommandLibrary

snmpbulkget

Retrieve large amounts of SNMP data quickly

TLDR

Request the next value from the SNMP agent

$ snmpbulkget -v [version] -c [community] [ip] [oid]
copy

Display the full Object Identifier (OID) path
$ snmpbulkget -v [version] -c [community] -O f [ip] [oid]
copy

Display help
$ snmpbulkget [[-h|--help]]
copy

SYNOPSIS

snmpbulkget [COMMON OPTIONS] AGENT [OID]...

snmpbulkget [SNMPv3 OPTIONS] AGENT [OID]...

PARAMETERS

-v <1|2c|3>
    Specifies the SNMP protocol version to use.

-c
    Sets the community string for SNMPv1 or SNMPv2c requests.

-r
    Defines the number of retries before timing out (default is 5).

-t
    Sets the timeout in seconds for the initial request (default is 1).

-l
    Sets the security level for SNMPv3: noAuthNoPriv, authNoPriv, or authPriv.

-u
    Specifies the security name (username) for SNMPv3 authentication.

-a
    Sets the authentication protocol for SNMPv3 (e.g., MD5, SHA).

-A
    Provides the authentication passphrase for SNMPv3.

-x
    Sets the privacy protocol for SNMPv3 (e.g., DES, AES).

-X
    Provides the privacy passphrase for SNMPv3.

-Cn
    Specifies the number of OIDs at the beginning of the OID list for which only a single GETNEXT operation is performed. (default is 0)

-Cr
    Specifies the maximum number of GETNEXT operations performed for the remaining 'repeater' OIDs. (default is 10)

-M
    Adds one or more directories to the MIB search path.

-O
    Controls the output format (e.g., q for quiet, f for full OID).

AGENT
    The hostname or IP address of the target SNMP agent.

OID...
    One or more Object Identifiers (OIDs) to query. These can be numeric or MIB-defined names.

DESCRIPTION

snmpbulkget is a command-line utility from the Net-SNMP suite used to query network devices via the Simple Network Management Protocol (SNMP). It specifically implements the SNMP GETBULK request, which is available in SNMPv2c and SNMPv3. Unlike snmpget (which retrieves a single OID) or snmpwalk (which performs a series of GETNEXT requests), snmpbulkget fetches multiple OIDs in a single request, significantly reducing network overhead and improving performance when querying large tables or sequential MIB objects. It's particularly useful for fetching an entire MIB subtree or large data sets from a device with fewer round trips. The command requires specifying the number of "non-repeaters" and "max repetitions" to control the bulk retrieval process.

CAVEATS

  • snmpbulkget is only supported by SNMPv2c and SNMPv3 agents. It will not work with SNMPv1 agents.
  • Understanding non-repeaters and max-repetitions is crucial for effective use; incorrect values can lead to unexpected or incomplete results.
  • Large max-repetitions values can put a significant load on the SNMP agent and network, potentially leading to timeouts or dropped packets if the agent is overwhelmed.
  • MIB files must be properly configured and accessible for symbolic OID names to resolve correctly; otherwise, only numeric OIDs can be used.

EFFICIENCY

snmpbulkget is significantly more efficient than snmpwalk for retrieving large tables or sequential data because it minimizes the number of round trips between the manager and the agent. This is achieved by sending a single request that asks for multiple OIDs and multiple instances of those OIDs, getting a large block of data back in one response.

USAGE WITH TABLES

When querying SNMP tables, the -Cn (non-repeaters) parameter is often set to 0, and -Cr (max-repetitions) is set to a value large enough to retrieve all desired rows, making it ideal for gathering entire table data efficiently.

HISTORY

The snmpbulkget command is part of the Net-SNMP suite, a widely used collection of applications and libraries for implementing SNMP. The GETBULK operation itself was introduced with SNMPv2 to address the inefficiency of retrieving large amounts of data using multiple GETNEXT requests (as snmpwalk does for SNMPv1). snmpbulkget was developed to provide a command-line interface to this more efficient operation, allowing network administrators to quickly and effectively query large datasets like routing tables or interface statistics from SNMP-enabled devices. Its evolution parallels the development and adoption of SNMPv2c and SNMPv3.

SEE ALSO

snmpget(1), snmpwalk(1), snmpset(1), snmptrap(1)

Copied to clipboard