Skip to main content

SNMP CLI Documentation

The MetricsHub SNMP CLI allows you to interact with SNMP-enabled devices using the GET, GETNEXT, WALK, and TABLE queries. When running the CLI, you can configure the SNMP version to be used (v1 or v2c), community string, port, and retry intervals. To use SNMP v3, refer to MetricsHub SNMPv3 CLI.

Before using the CLI, ensure your platform supports SNMP monitoring by checking the Supported Platforms.

Syntax

SNMP Get Request

snmpcli HOSTNAME --get OID --community COMMUNITY --version VERSION --port PORT --timeout TIMEOUT --retry INTERVAL1,INTERVAL2,...

SNMP Get Next Request

snmpcli HOSTNAME --getNext OID --community COMMUNITY --version VERSION --port PORT --timeout TIMEOUT --retry INTERVAL1,INTERVAL2,...

SNMP Walk Request

snmpcli HOSTNAME --walk OID --community COMMUNITY --version VERSION --port PORT --timeout TIMEOUT --retry INTERVAL1,INTERVAL2,...

SNMP Table Request

snmpcli HOSTNAME --table OID --columns COLUMN,COLUMN,... --community COMMUNITY --version VERSION --port PORT --timeout TIMEOUT --retry INTERVAL1,INTERVAL2,...

Options

OptionDescriptionDefault Value
HOSTNAMEHostname or IP address of the SNMP-enabled device. This option is required.None
--versionSNMP version to use. Possible values: 1 or 2c.2c
--communityCommunity string for SNMP authentication.public
--portPort on which the SNMP agent is listening.161
--timeoutTimeout in seconds for SNMP operations.5
--retryComma-separated retry intervals in milliseconds (e.g., 500,1000).None
--getOID for SNMP Get request.None
--getNextOID for SNMP Get Next request.None
--walkOID for SNMP Walk request.None
--tableOID for SNMP Table request.None
--columnsComma-separated list of column names for SNMP Table request.None
-vEnables verbose mode. Use -v for basic logs, -vv for detailed logs.None
-h, --helpDisplays detailed help information about available options.None

Examples

Example 1: SNMP Get Request

snmpcli dev-01 --get 1.3.6.1.4.1.674.10892.5.5.1.20.130.4.1.1.1 --community public --version v2c --port 161 --timeout 60 --retry 500,1000

Example 2: SNMP Get Next Request

snmpcli dev-01 --getNext 1.3.6.1.4.1.674.10892.5.5.1.20.130.4 --community public --version v2c --port 161 --timeout 60 --retry 500,1000

Example 3: SNMP Walk Request

snmpcli dev-01 --walk 1.3.6.1 --community public --version v1 --port 161 --timeout 60 --retry 500,1000

Example 4: SNMP Table Request

snmpcli dev-01 --table 1.3.6.1.4.1.674.10892.5.4.300.10.1 --columns 1,3,8,9,11 --community public --version v1 --port 161 --timeout 60 --retry 500,1000