Command Line Reference
Network Management And Monitor...
SNMP Configuration
13 min
snmp configuration snmp configuration show snmp agent trap target show snmp agent trap target \[command] show snmp agent trap target \[purpose] display snmp trap server configuration \[view] system view \[use cases] sonic# show snmp agent trap target version trapreceiverip port vrf community user \ 2 1 1 1 1 162 none testa show snmp agent source show snmp agent source \[command] show snmp agent source \[purpose] display the snmp source address and port configuration \[view] system view \[use cases] sonic# show snmp agent source listenip listenport listenvrf \ 30 11 0 82 show snmp agent user show snmp agent user \[command] show snmp agent user \[purpose] display snmpv3 user configuration \[view] system view \[use cases] sonic# show snmp agent user user type authtype encryptiontype \ test noauthnopriv show snmp agent threshold show snmp agent threshold \[command] show snmp agent threshold \[purpose] display snmp alarm threshold configuration \[view] system view \[use cases] sonic# show snmp agent threshold threshold type threshold value \ cpu usage 80% memory usage 80% snmp agent enable snmp agent enable \[command] snmp agent enable no snmp agent enable \[purpose] enable snmp function \[view] system configure view \[use cases] sonic(config)# snmp agent enable snmp agent community snmp agent community \[command] snmp agent community community name no snme agent community community name \[purpose] add snmp community \[parameter] parameter description community name community name \[view] system configuration view \[usage scenario] the community name like a password, and devices within the community use this name for authentication during communication only devices with the same configured community name can access each other by default, the community name is set to public \[use cases] sonic(config)# snmp agent community snmptest snmp agent user snmp agent user \[command] snmp agent user name authnopriv {md5|sha} password snmp agent user name priv {md5|sha} {des|aes} password snmp agent user name noauthnopriv no snmp agent user name \[purpose] create snmpv3 users \[parameter] parameter description name user name authnopriv specify the security level as requiring authentication, and specify the authentication method as md5/sha noauthnopriv specify the security level as no authentication required priv {md5|sha} specify the security level as encryption {des|aes} specify the encryption algorithm \[view] system configuration view \[usage scenario] snmpv3 provides encryption and authentication mechanisms to safeguard the management information of network devices from unauthorized access therefore, in high security network environments, using snmpv3 can better protect the security of network devices \[use cases] sonic(config)# snmp agent user user3 priv md5 12345678 des 87654321 sonic(config)# snmp agent user user4 noauthnopriv sonic(config)# snmp agent user user5 authnopriv md5 12345678 snmp agent trap target threshold system usage snmp agent trap target threshold system usage \[command] snmp agent trap target threshold {reset|system usage} {cpu usage|memory usage} value snmp agent trap target threshold reset system usage \[purpose] enable specific utilization alarm switch \[parameter] parameter description cpu usage cpu utilization memory usage memory utilization value alarm threshold \[view] system configuration view \[use cases] sonic(config)# snmp agent trap target threshold system usage memory usage 70 snmp agent trap target {1|2|3} snmp agent trap target {1|2|3} \[command] snmp agent trap target {1|2|3} address \[udp port portname ] \[vrf vrfname ] \[community community name ] no snmp agent trap target {1|2|3} \[purpose] configure the server for agent trap \[parameter] parameter description address ip address portnum port number, default 162 vrfname vrf name name agent community \[view] system configuration view \[usage scenario] devices send alarm messages that can be uploaded to a trap server using the trap command in this case, the snmp trap server needs to be configured however, the reliability of trap messages is lower because the sender cannot confirm whether the trap message has been received, as the recipient does not send acknowledgment messages \[use cases] sonic# configure terminal sonic(config)# snmp agent trap target v1 10 250 0 221 sonic(config)# snmp agent trap target v2c 10 250 0 221 udp port 163 community comm1 snmp agent source udp port snmp agent source udp port \[command] snmp agent source { a b c d/a b | interface name | loopback} \[udp port portnum |vrf vrf name ] \[purpose] configure the source ip address of the device to send snmp protocol packets \[parameter] parameter description a b c d/a b ip address interface name interface name ,can only be configured as loopback0 loopback loopback portnum the port number, default is 161 \[view] system configuration view \[use cases] sonic# configure terminal sonic(config)# snmp agent source 10 250 0 221
