Skip to content

How to Check SNMP Configuration

Qi Luo edited this page Aug 24, 2018 · 1 revision

You need to have sudo privilege to follow this TSG.

Set SNMP community string

Use VIM editor to modify the file

vim /etc/sonic/snmp.yml

Change the value after 'snmp_rocommunity: ' and don't touch any other lines. For example if you want to use 'public' as the community string:

snmp_rocommunity: public

Apply the changes by command line

sudo systemctl restart snmp

How to verify SNMP is working with correct community string

Use the command line

sudo docker exec -it snmp snmpwalk -v2c -c public 127.0.0.1 iso.3.6.1.2.1.1.1.0

And the sample output is below.

admin@sonic:~$ sudo docker exec -it snmp snmpwalk -v2c -c public 127.0.0.1 iso.3.6.1.2.1.1.1.0
iso.3.6.1.2.1.1.1.0 = STRING: "SONiC Software Version: SONiC.HEAD.132-a32534f - HwSku: Mellanox-SN2700 - Distribution: Debian 8.11 - Kernel: 3.16.0-5-amd64"
Clone this wiki locally