config snmp location (add | del | modify) <location>
SNMP is a component of the Internet Protocol Suite as defined by the Internet Engineering Task Force (IETF). SNMP is widely used in network management for network monitoring. It consists of a set of standards for network management, including an application layer protocol, a database schema, and a set of data objects.
Example model & SONiC version:
Some SONiC releases don’t have a CLI command to modify an SNMP community. Edit the file /etc/sonic/snmp.yml instead. |
This sub-section explains how to configure SNMP.
This command is used to add, delete, or modify the SNMP location.
Usage:
config snmp location (add | del | modify) <location>
Example (Add new SNMP location “Main Office” if it does not already exist):
admin@sonic:~$ sudo config snmp location add Main Office
SNMP Location Main Office has been added to configuration
Restarting SNMP service...
Example (Delete SNMP location “Main Office” if it already exists):
admin@sonic:~$ sudo config snmp location del Main Office
SNMP Location Main Office removed from configuration
Restarting SNMP service...
Example (Modify SNMP location “Main Office” to “Backup”):
admin@sonic:~$ sudo config snmp location modify Backup
SNMP location Backup modified in configuration
Restarting SNMP service...
This command is used to add, delete, or modify the SNMP contact.
Usage:
config snmp contact add <contact> <contact_email>
Example:
admin@sonic:~$ sudo config snmp contact add user user@domain.com
Contact name user and contact email user@domain.com have been added to configuration
Restarting SNMP service...
Usage:
config snmp contact del <contact>
Example:
admin@sonic:~$ sudo config snmp contact del user
SNMP contact user removed from configuration
Restarting SNMP service...
Usage:
config snmp contact modify <contact> <contact_email>
Example:
admin@sonic:~$ sudo config snmp contact modify test test@domain.com
SNMP contact test and contact email test@domain.com updated
Restarting SNMP service...
This command is used to add, delete, or replace the SNMP community.
Usage:
config snmp community add <community> (RO | RW)
Example:
admin@sonic:~$ sudo config snmp community add netberg ro
SNMP community netberg added to configuration
Restarting SNMP service...
Usage:
config snmp community del <community>
Example:
admin@sonic:~$ sudo config snmp community del netberg
SNMP community netberg removed from configuration
Restarting SNMP service...
Usage:
config snmp community replace <community> <new_community>
Example:
admin@sonic:~$ sudo config snmp community replace netberg newnetberg
SNMP community newnetberg added to configuration
SNMP community newnetberg replace community netberg
Restarting SNMP service...
This command is used to add or delete the SNMP user for SNMPv3.
Usage:
config snmp user add <user> (noAuthNoPriv|AuthNoPriv|Priv) (RO|RW) [[(MD5|SHA|MMAC-SHA-2) <auth_password>] [(DES|AES) <encrypt_password>]]
Example:
admin@sonic:~$ sudo config snmp user add testuser1 noauthnopriv ro
SNMP user testuser1 added to configuration
Restarting SNMP service...
Example:
admin@sonic:~$ sudo config snmp user add testuser2 authnopriv ro sha testuser2_auth_pass
SNMP user testuser2 added to configuration
Restarting SNMP service...
Example:
admin@sonic:~$ sudo config snmp user add testuser3 priv rw md5 testuser3_auth_pass aes testuser3_encrypt_pass
SNMP user testuser3 added to configuration
Restarting SNMP service...
Usage:
config snmp user del <user>
Example:
admin@sonic:~$ sudo config snmp user del testuser1
SNMP user testuser1 removed from configuration
Restarting SNMP service...
This command displays the global SNMP configuration that includes the location, contact, community, and user settings.
Usage:
show runningconfiguration snmp
Example:
admin@sonic:~$ show runningconfiguration snmp
Location
------------
Netberg
SNMP_CONTACT SNMP_CONTACT_EMAIL
-------------- --------------------
user user@domain.com
Community String Community Type
------------------ ----------------
public RO
User Permission Type Type Auth Type Auth Password Encryption Type Encryption Password
------ ----------------- ------ ----------- --------------- ----------------- ---------------------
admin RO Priv SHA adminAuthPass AES adminEncryptPass
This command displays the SNMP location setting.
Usage:
show runningconfiguration snmp location
Example:
admin@sonic:~$ show runningconfiguration snmp location
Location
------------
Netberg
Usage:
show runningconfiguration snmp location --json
Example:
admin@sonic:~$ show runningconfiguration snmp location --json
{'Location': 'Netberg'}
This command displays the SNMP contact setting.
Usage:
show runningconfiguration snmp contact
Example:
admin@sonic:~$ show runningconfiguration snmp contact
Contact Contact Email
--------- ---------------
user user@domain.com
Usage:
show runningconfiguration snmp contact --json
Example:
admin@sonic:~$ show runningconfiguration snmp contact --json
{'user': 'user@domain.com'}
This command display the SNMP community settings.
Usage:
show runningconfiguration snmp community
Example:
admin@sonic:~$ show runningconfiguration snmp community
Community String Community Type
------------------ ----------------
public RO
Usage:
show runningconfiguration snmp community –json
Example:
admin@sonic:~$ show runningconfiguration snmp community --json
{'public': {'TYPE': 'RO'}}
This command display the SNMP user settings.
Usage:
show runningconfiguration snmp user
Example:
admin@sonic:~$ show runningconfiguration snmp user
User Permission Type Type Auth Type Auth Password Encryption Type Encryption Password
--------- ----------------- ------------ ----------- ------------------- ----------------- ---------------------
admin RO noAuthNoPriv
Usage:
show runningconfiguration snmp user --json
Example:
admin@sonic:~$ show runningconfiguration snmp user --json
{'admin': {'SNMP_USER_AUTH_PASSWORD': '', 'SNMP_USER_AUTH_TYPE': '', 'SNMP_USER_ENCRYPTION_PASSWORD': '', 'SNMP_USER_ENCRYPTION_TYPE': '', 'SNMP_USER_PERMISSION': 'RO', 'SNMP_USER_TYPE': 'noAuthNoPriv'}}
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
Example:
iso.3.6.1.2.1.1.1.0 = STRING: "SONiC Software Version: SONiC.202111.0-dirty-20230321.222722 - HwSku: aurora-710 - Distribution: Debian 11.6 - Kernel: 5.10.0-8-2-amd64"
Create a new host using LINUX by SNMP template.
apt install snmp-mibs-downloader download-mibs
Check the hosts monitoring page.
Check SONiC interface data using the “show interfaces counters” command.
Verify statistics in Zabbix.
Netberg announced the new Aurora 810 400G model programmable switch with Intel Tofino 2 Intelligent Fabric Processors (IFPs) at its heart. The new platform has 32x 400G QSFP-DD Ethernet ports and a 12.8Tbps switching capacity.
Taipei, Taiwan, 24th of October 2022. Netberg participates in the new round of the Fast Forward Initiative by Intel (FFI'22). The program supports academic and research organizations today, aiming at accelerating tomorrow's best network programmability research.
Taipei, Taiwan 13th of July 2022. Netberg launches its hardened SONiC distribution for Intel Tofino and Marvell Teralynx platforms.
Taipei, Taiwan 8th of November 2021. Netberg’s SONiC platform code for Aurora 715 and Aurora 615 Innovium Teralynx-based switches is accepted into the official GitHub repository.
Taipei, Taiwan 1st of June 2021. Netberg, a leading open networking vendor, announces two new Aurora 715 and Aurora 615 models - high-performance 25/100G switches for future-proof Cloud, Enterprise, and Edge data centers.
Taipei, Taiwan 17th of November 2020. Netberg announces new services - custom networking software and hardware development.