SNMP
SNMP View
Table 1 SNMP View
Command | Purpose |
|---|---|
show snmp-agent trap-target | Display trap configuration of SNMP agent. |
show snmp-agent source | Display source of SNMP agent. |
show snmp-agent user | Display SNMPv3 user configuration. |
show snmp-agent community | Display SNMP community configuration. |
show snmp-agent control | Display SNMP control information for Asterfusion private nodes/BGP nodes/RIB nodes. |
show snmp-agent trap-target
[Command] show snmp-agent trap-target
[Purpose] Display SNMP agent trap configuration.
[View] Privileged User View
[Use Cases]
sonic# show snmp-agent trap-targetshow snmp-agent source
[Command] show snmp-agent source
[Purpose] Display SNMP agent source.
[View] Privileged User View
[Use Cases]
sonic# show snmp-agent sourceshow snmp-agent user
[Command] show snmp-agent user
[Purpose] Display SNMPv3 user configuration.
[View] Privileged User View
[Use Cases]
sonic# show snmp-agent usershow snmp-agent community
[Command] show snmp-agent community
[Purpose] Display SNMP community configuration.
[View] Privileged User View
[Use Cases]
sonic# show snmp-agent communityshow snmp-agent control
[Command] show snmp-agent control
[Purpose] Display SNMP control information for Asterfusion private nodes.
[View] Privileged User View
[Use Cases]
Evpn-Leaf169# show snmp-agent control
Switch String Switch State
------------------- --------------
bgp disable
rib disable
roce-running-config disable
roce-stats disableSNMP Config
Table 2 SNMP Config
Command | Purpose |
|---|---|
snmp-agent community [cipher] community_name [RO|RW] | Configure the community of SNMP agent. |
snmp-agent user user_name [authentication-mode authen-protocol authKey [privacy-mode privacy-protocol privKey]] | Configure the user of SNMP agent. |
snmp-agent trap-target {v1|v2c|v3} ip-address [udp-port portnum] [vrf vrf_name] [community community_name|user user_name] | Configure the trap target of SNMP agent. |
snmp-agent source ip-address [udp-port portnum] [vrf vrf_name] | Configure the listening address of SNMP agent. |
snmp-agent control enable {roce stats| roce running-config |bgp |rib} | Allow SNMP agent to access Asterfusion private nodes/BGP nodes/RIB nodes. |
snmp-agent community [cipher] community_name [RO|RW]
[Command] snmp-agent community [cipher] community_name [RO|RW]
[Purpose] Configure the community of SNMP agent.
[Parameters]
Parameter | Description |
|---|---|
cipher | Configuration of cipher mode |
community_name | Community name |
RO | Read-Only, the default value is RO |
RW | Read-Write |
[View] Global Configuration View
[Notes] Run command no snmp-agent [cipher] community community_name to delete SNMP community configuration.
[Use Cases]
sonic# configure terminal
sonic(config)# snmp-agent community comm1 ROsnmp-agent user user_name [authentication-mode authen-protocol authKey [privacy-mode privacy-protocol privKey]]
[Command] snmp-agent user user_name [authentication-mode authen-protocol authKey [privacy-mode privacy-protocol privKey]]
[Purpose] Configure the user of SNMP agent.
[Parameters]
Parameter | Description |
|---|---|
user_name | Name of the user. |
authen-protocol | Authentication protocol, either md5 or sha. |
authKey | Authentication password, in string form, length 8-32 bits. |
privacy-protocol | Privacy protocol, either des or aes. |
privKey | Privacy key, in string form, length 8-32 bits. |
[View] Global Configuration View
[Notes] Run command no snmp-agent user user_name to delete SNMPv3 agent user configuration.
[Use Cases]
sonic# configure terminal
sonic(config)# snmp-agent user user3 authentication-mode md5 12345678 privacy-mode des 87654321
sonic(config)# snmp-agent user user4
sonic(config)# snmp-agent user user5 authentication-mode md5 12345678snmp-agent trap-target {v1|v2c|v3} ip-address [udp-port portnum] [vrf vrf_name] [community community_name|user user_name]
[Command] snmp-agent trap-target {v1|v2c|v3} ip-address [udp-port portnum] [vrf vrf_name] [community community_name|user user_name]
[Purpose] Configure the trap target of SNMP agent.
[Parameters]
Parameter | Description |
|---|---|
ip-address | SNMP-Agent Trap Target IP address |
portnum | Specify the port number, the default is 162. |
vrf_name | Specify the VRF name, the default VRF is default. |
community_name | Community name. |
user_name | Name of the user. |
[View] Global Configuration View
[Notes] Run command no snmp-agent trap-target {v1|v2c|v3} to delete the trap target of SNMP agent.
[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 comm1snmp-agent source ip-address [udp-port portnum] [vrf vrf_name]
[Command] snmp-agent source ip-address [udp-port portnum] [vrf vrf_name]
[Purpose] Configure the listening address of SNMP agent.
[Parameters]
Parameter | Description |
|---|---|
ip-address | The listening IP address. |
portnum | Specify the port number, the default is 161. |
vrf_name | Specify the VRF name, the default VRF is default. |
[View] Global Configuration View
[Notes] Run command no snmp-agent source ip-address to delete the listening address of SNMP agent.
[Use Cases]
sonic# configure terminal
sonic(config)# snmp-agent source 10.250.0.221
sonic(config)# snmp-agent source 10.250.0.221 udp-port 163snmp-agent control enable {roce stats| roce running-config |bgp |rib}
[Command] snmp-agent control enable {roce stats|roce running-config|bgp|rib}
[Purpose] Allow SNMP agent to access Asterfusion private nodes/BGP nodes/RIB nodes
[Parameters]
Parameter | Description |
|---|---|
roce running-config | Configuration information of RoCE related ports and queues |
roce stats | Traffic statistics of RoCE-related ports and queues |
bgp | BGP information |
rib | RIB information, include arp, MAC, route |
[View] Global Configuration View
[Notes] Disabled by default, needs to be enabled manually. Run command no snmp-agent control enable {roce stats| roce running-config |bgp |rib} to disable this function
[Use Cases]
sonic# configure terminal
sonic(config)# snmp-agent control enable roce stats
Restarting SNMP service...