---
title: SNMP
slug: aidc/snmp
createdAt: 2025-12-01T11:11:10.000Z
---

## <font color="#1d50a2">SNMP View</font>

<font color="#1d05a2">Table 1 SNMP View</font>

| **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. |

### <font color="#1d50a2">show snmp-agent trap-target</font>

**\[Command]**
**show snmp-agent trap-target**

**\[Purpose]**
Display SNMP agent trap configuration.

**\[View]**
Privileged User View

**\[Use Cases]**

```plaintext
sonic# show snmp-agent trap-target
```

### <font color="#1d50a2">show snmp-agent source</font>

**\[Command]**
**show snmp-agent source**

**\[Purpose]**
Display SNMP agent source.

**\[View]**
Privileged User View

**\[Use Cases]**

```plaintext
sonic# show snmp-agent source
```

### <font color="#1d50a2">show snmp-agent user</font>

**\[Command]**
**show snmp-agent user**

**\[Purpose]**
Display SNMPv3 user configuration.

**\[View]**
Privileged User View

**\[Use Cases]**

```plaintext
sonic# show snmp-agent user
```

### <font color="#1d50a2">show snmp-agent community</font>

**\[Command]**
**show snmp-agent community**

**\[Purpose]**
Display SNMP community configuration.

**\[View]**
Privileged User View

**\[Use Cases]**

```plaintext
sonic# show snmp-agent community
```

### <font color="#1d50a2">show snmp-agent control</font>

**\[Command]**
**show snmp-agent control**

**\[Purpose]**
Display SNMP control information for Asterfusion private nodes.

**\[View]**
Privileged User View

**\[Use Cases]**

```plaintext
Evpn-Leaf169# show snmp-agent control
Switch String        Switch State
-------------------  --------------
bgp                  disable
rib                  disable
roce-running-config  disable
roce-stats           disable
```

## <font color="#1d50a2">SNMP Config</font>

<font color="#1d05a2">Table 2 SNMP Config</font>

| **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. |

### <font color="#1d50a2">snmp-agent community \[cipher\] *community\_name* \[RO|RW\]</font>

**\[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]**

```plaintext
sonic# configure terminal
sonic(config)# snmp-agent community comm1 RO
```

### <font color="#1d50a2">snmp-agent user *user\_name* \[authentication-mode *authen-protocol authKey* \[privacy-mode *privacy-protocol privKey*\]\]</font>

**\[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]**

```plaintext
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 12345678
```

### <font color="#1d50a2">snmp-agent trap-target \{v1|v2c|v3\} *ip-address* \[udp-port *portnum*\] \[vrf *vrf\_name*\] \[community *community\_name*|user *user\_name*\]</font>

**\[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]**

```plaintext
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
```

### <font color="#1d50a2">snmp-agent source *ip-address* \[udp-port *portnum*\] \[vrf *vrf\_name*\]</font>

**\[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]**

```plaintext
sonic# configure terminal
sonic(config)# snmp-agent source 10.250.0.221
sonic(config)# snmp-agent source 10.250.0.221 udp-port 163
```

### <font color="#1d50a2">snmp-agent control enable \{roce stats| roce running-config |bgp |rib\}</font>

**\[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]**

```plaintext
sonic# configure terminal
sonic(config)# snmp-agent control enable roce stats
Restarting SNMP service...
```

