Simple Network Management Protocol

The Simple Network Management Protocol (SNMP) is a management protocol that allows users to monitor and administer network devices. SNMP can retrieve and modify configurations on network devices.

Change the SNMP community

To change the SNMP community for the device, open the /etc/sonic/snmp.yml file for editing

admin@sonic:~$ sudo vim /etc/sonic/snmp.yml

In this file, set the values for snmp_rocommunity and snmp_location. The default contents of the file look like:

admin@sonic:~$ sudo cat /etc/sonic/snmp.yml
snmp_rocommunity: public
snmp_location: public

After editing, save and close the file and issue a config reload:

admin@sonic:~$ sudo config reload -y
Disabling container monitoring ...
Stopping SONiC target ...
Running command: /usr/local/bin/sonic-cfggen -j /etc/sonic/init_cfg.json -j /etc/sonic/config_db.json --write-to-db
Running command: /usr/local/bin/db_migrator.py -o migrate
Running command: /usr/local/bin/sonic-cfggen -d -y /etc/sonic/sonic_version.yml -t /usr/share/sonic/templates/sonic-environment.j2,/etc/sonic/sonic-environment
Restarting SONiC target ...
Enabling container monitoring ...
Reloading Monit configuration ...
Reinitializing monit daemon