Skip to content

Commit 9d5b970

Browse files
authored
[Command-Reference.md] Document new SNMP show and config commands (sonic-net#1600)
* [show][config] SNMP commands added * fixed quotes for backticks * Fixed run for runningconfiguration and Del for Delete * changed admin@switch1 to admin@sonic and removed trailing prompt * updated Usage statements for SNMP * Updated for optional and required values * updated to remove unneeded example () statements * updated typo's
1 parent 9fc630c commit 9d5b970

File tree

1 file changed

+311
-1
lines changed

1 file changed

+311
-1
lines changed

doc/Command-Reference.md

+311-1
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@
115115
* [sFlow](#sflow)
116116
* [sFlow Show commands](#sflow-show-commands)
117117
* [sFlow Config commands](#sflow-config-commands)
118+
* [SNMP](#snmp)
119+
* [SNMP Show commands](#snmp-show-commands)
120+
* [SNMP Config commands](#snmp-config-commands)
118121
* [Startup & Running Configuration](#startup--running-configuration)
119122
* [Startup Configuration](#startup-configuration)
120123
* [Running Configuration](#running-configuration)
@@ -156,6 +159,7 @@
156159

157160
| Version | Modification Date | Details |
158161
| --- | --- | --- |
162+
| v6 | May-06-2021 | Add SNMP show and config commands |
159163
| v5 | Nov-05-2020 | Add document for console commands |
160164
| v4 | Oct-17-2019 | Unify usage statements and other formatting; Replace tabs with spaces; Modify heading sizes; Fix spelling, grammar and other errors; Fix organization of new commands |
161165
| v3 | Jun-26-2019 | Update based on 201904 (build#19) release, "config interface" command changes related to interfacename order, FRR/Quagga show command changes, platform specific changes, ACL show changes and few formatting changes |
@@ -3198,7 +3202,7 @@ The "errors" subcommand is used to display the interface errors.
31983202
31993203
The "rates" subcommand is used to disply only the interface rates.
32003204
3201-
- Exmaple:
3205+
- Example:
32023206
```
32033207
admin@str-s6000-acs-11:/usr/bin$ show int counters rates
32043208
IFACE STATE RX_OK RX_BPS RX_PPS RX_UTIL TX_OK TX_BPS TX_PPS TX_UTIL
@@ -6691,6 +6695,312 @@ This command is used to set the counter polling interval. Default is 20 seconds.
66916695
66926696
Go Back To [Beginning of the document](#) or [Beginning of this section](#sflow)
66936697
6698+
## SNMP
6699+
6700+
### SNMP Show commands
6701+
6702+
**show runningconfiguration snmp**
6703+
6704+
This command displays the global SNMP configuration that includes the location, contact, community, and user settings.
6705+
6706+
- Usage:
6707+
```
6708+
show runningconfiguration snmp
6709+
```
6710+
6711+
- Example:
6712+
```
6713+
admin@sonic:~$ show runningconfiguration snmp
6714+
Location
6715+
------------
6716+
Emerald City
6717+
6718+
6719+
SNMP_CONTACT SNMP_CONTACT_EMAIL
6720+
-------------- --------------------
6721+
6722+
6723+
6724+
Community String Community Type
6725+
------------------ ----------------
6726+
Jack RW
6727+
6728+
6729+
User Permission Type Type Auth Type Auth Password Encryption Type Encryption Password
6730+
------ ----------------- ------ ----------- --------------- ----------------- ---------------------
6731+
Travis RO Priv SHA TravisAuthPass AES TravisEncryptPass
6732+
```
6733+
6734+
**show runningconfiguration snmp location**
6735+
6736+
This command displays the SNMP location setting.
6737+
6738+
- Usage:
6739+
```
6740+
show runningconfiguration snmp location
6741+
```
6742+
6743+
- Example:
6744+
```
6745+
admin@sonic:~$ show runningconfiguration snmp location
6746+
Location
6747+
------------
6748+
Emerald City
6749+
```
6750+
6751+
- Usage:
6752+
```
6753+
show runningconfiguration snmp location --json
6754+
```
6755+
6756+
- Example:
6757+
```
6758+
admin@sonic:~$ show runningconfiguration snmp location --json
6759+
{'Location': 'Emerald City'}
6760+
```
6761+
6762+
**show runningconfiguration snmp contact**
6763+
6764+
This command displays the SNMP contact setting.
6765+
6766+
- Usage:
6767+
```
6768+
show runningconfiguration snmp contact
6769+
```
6770+
6771+
- Example:
6772+
```
6773+
admin@sonic:~$ show runningconfiguration snmp contact
6774+
Contact Contact Email
6775+
--------- ---------------
6776+
6777+
```
6778+
6779+
- Usage:
6780+
```
6781+
show runningconfiguration snmp contact --json
6782+
```
6783+
6784+
- Example:
6785+
```
6786+
admin@sonic:~$ show runningconfiguration snmp contact --json
6787+
{'joe': '[email protected]'}
6788+
```
6789+
6790+
**show runningconfiguration snmp community**
6791+
6792+
This command display the SNMP community settings.
6793+
6794+
- Usage:
6795+
```
6796+
show runningconfiguration snmp community
6797+
```
6798+
6799+
- Example:
6800+
```
6801+
admin@sonic:~$ show runningconfiguration snmp community
6802+
Community String Community Type
6803+
------------------ ----------------
6804+
Jack RW
6805+
```
6806+
6807+
- Usage:
6808+
```
6809+
show runningconfiguration snmp community --json
6810+
```
6811+
6812+
- Example:
6813+
```
6814+
admin@sonic:~$ show runningconfiguration snmp community --json
6815+
{'Jack': {'TYPE': 'RW'}}
6816+
```
6817+
6818+
**show runningconfiguration snmp user**
6819+
6820+
This command display the SNMP user settings.
6821+
6822+
- Usage:
6823+
```
6824+
show runningconfiguration snmp user
6825+
```
6826+
6827+
- Example:
6828+
```
6829+
admin@sonic:~$ show runningconfiguration snmp user
6830+
User Permission Type Type Auth Type Auth Password Encryption Type Encryption Password
6831+
------ ----------------- ------ ----------- --------------- ----------------- ---------------------
6832+
Travis RO Priv SHA TravisAuthPass AES TravisEncryptPass
6833+
```
6834+
6835+
- Usage:
6836+
```
6837+
show runningconfiguration snmp user --json
6838+
```
6839+
6840+
- Example:
6841+
```
6842+
admin@sonic:~$ show runningconfiguration snmp user --json
6843+
{'Travis': {'SNMP_USER_TYPE': 'Priv', 'SNMP_USER_PERMISSION': 'RO', 'SNMP_USER_AUTH_TYPE': 'SHA', 'SNMP_USER_AUTH_PASSWORD': 'TravisAuthPass', 'SNMP_USER_ENCRYPTION_TYPE': 'AES', 'SNMP_USER_ENCRYPTION_PASSWORD': 'TravisEncryptPass'}}
6844+
```
6845+
6846+
6847+
### SNMP Config commands
6848+
6849+
This sub-section explains how to configure SNMP.
6850+
6851+
**config snmp location add/del/modify**
6852+
6853+
This command is used to add, delete, or modify the SNMP location.
6854+
6855+
- Usage:
6856+
```
6857+
config snmp location (add | del | modify) <location>
6858+
```
6859+
6860+
- Example (Add new SNMP location "Emerald City" if it does not already exist):
6861+
```
6862+
admin@sonic:~$ sudo config snmp location add Emerald City
6863+
SNMP Location Emerald City has been added to configuration
6864+
Restarting SNMP service...
6865+
```
6866+
6867+
- Example (Delete SNMP location "Emerald City" if it already exists):
6868+
```
6869+
admin@sonic:~$ sudo config snmp location del Emerald City
6870+
SNMP Location Emerald City removed from configuration
6871+
Restarting SNMP service...
6872+
```
6873+
6874+
- Example (Modify SNMP location "Emerald City" to "Redmond"):
6875+
```
6876+
admin@sonic:~$ sudo config snmp location modify Redmond
6877+
SNMP location Redmond modified in configuration
6878+
Restarting SNMP service...
6879+
```
6880+
6881+
**config snmp contact add/del/modify**
6882+
6883+
This command is used to add, delete, or modify the SNMP contact.
6884+
6885+
- Usage:
6886+
```
6887+
config snmp contact add <contact> <contact_email>
6888+
```
6889+
6890+
- Example:
6891+
```
6892+
admin@sonic:~$ sudo config snmp contact add joe [email protected]
6893+
Contact name joe and contact email [email protected] have been added to configuration
6894+
Restarting SNMP service...
6895+
```
6896+
6897+
- Usage:
6898+
```
6899+
config snmp contact del <contact>
6900+
```
6901+
6902+
- Example:
6903+
```
6904+
admin@sonic:~$ sudo config snmp contact del joe
6905+
SNMP contact joe removed from configuration
6906+
Restarting SNMP service...
6907+
```
6908+
6909+
- Usage:
6910+
```
6911+
config snmp contact modify <contact> <contact_email>
6912+
```
6913+
6914+
- Example:
6915+
```
6916+
admin@sonic:~$ sudo config snmp contact modify test [email protected]
6917+
SNMP contact test and contact email [email protected] updated
6918+
Restarting SNMP service...
6919+
```
6920+
6921+
**config snmp community add/del/replace**
6922+
6923+
This command is used to add, delete, or replace the SNMP community.
6924+
6925+
- Usage:
6926+
```
6927+
config snmp community add <community> (RO | RW)
6928+
```
6929+
6930+
- Example:
6931+
```
6932+
admin@sonic:~$ sudo config snmp community add testcomm ro
6933+
SNMP community testcomm added to configuration
6934+
Restarting SNMP service...
6935+
```
6936+
6937+
- Usage:
6938+
```
6939+
config snmp community del <community>
6940+
```
6941+
6942+
- Example:
6943+
```
6944+
admin@sonic:~$ sudo config snmp community del testcomm
6945+
SNMP community testcomm removed from configuration
6946+
Restarting SNMP service...
6947+
```
6948+
6949+
- Usage:
6950+
```
6951+
config snmp community replace <community> <new_community>
6952+
```
6953+
6954+
- Example:
6955+
```
6956+
admin@sonic:~$ sudo config snmp community replace testcomm newtestcomm
6957+
SNMP community newtestcomm added to configuration
6958+
SNMP community newtestcomm replace community testcomm
6959+
Restarting SNMP service...
6960+
```
6961+
6962+
**config snmp user add/del**
6963+
6964+
This command is used to add or delete the SNMP user for SNMPv3.
6965+
6966+
- Usage:
6967+
```
6968+
config snmp user add <user> (noAuthNoPriv | AuthNoPriv | Priv) (RO | RW) [[(MD5 | SHA | MMAC-SHA-2) <auth_password>] [(DES |AES) <encrypt_password>]]
6969+
```
6970+
6971+
- Example:
6972+
```
6973+
admin@sonic:~$ sudo config snmp user add testuser1 noauthnopriv ro
6974+
SNMP user testuser1 added to configuration
6975+
Restarting SNMP service...
6976+
```
6977+
6978+
- Example:
6979+
```
6980+
admin@sonic:~$ sudo config snmp user add testuser2 authnopriv ro sha testuser2_auth_pass
6981+
SNMP user testuser2 added to configuration
6982+
Restarting SNMP service...
6983+
```
6984+
6985+
- Example:
6986+
```
6987+
admin@sonic:~$ sudo config snmp user add testuser3 priv rw md5 testuser3_auth_pass aes testuser3_encrypt_pass
6988+
SNMP user testuser3 added to configuration
6989+
Restarting SNMP service...
6990+
```
6991+
6992+
- Usage:
6993+
```
6994+
config snmp user del <user>
6995+
```
6996+
6997+
- Example:
6998+
```
6999+
admin@sonic:~$ sudo config snmp user del testuser1
7000+
SNMP user testuser1 removed from configuration
7001+
Restarting SNMP service...
7002+
```
7003+
66947004
## Startup & Running Configuration
66957005
66967006
### Startup Configuration

0 commit comments

Comments
 (0)