---
title: SNMP Configuration
slug: enterprise-v5p2/g8D4-snmp-configuration
description: network management and monitoring
createdAt: 2025-11-14T03:58:40.683Z
---

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

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

**\[Purpose]**
Display SNMP trap server configuration

**\[View]**
System view

**\[Use Cases]**

```plaintext
sonic# show snmp-agent trap-target
 Version  TrapReceiverIP   Port   VRF   Community   User
--------- ---------------- ------ ----- ----------- ------
    2      1.1.1.1          162   None    testa      -
```

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

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

**\[Purpose]**
Display the SNMP source address and port configuration

**\[View]**
System view

**\[Use Cases]**

```plaintext
sonic# show snmp-agent source
ListenIP   ListenPort   ListenVrf
---------- ------------ -----------
30.11.0.82
```

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

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

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

**\[View]**
System view

**\[Use Cases]**

```plaintext
sonic# show snmp-agent user
User   Type         AuthType   EncryptionType
------ ------------ ---------- ----------------
test   noAuthNoPriv
```

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

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

**\[Purpose]**
Display SNMP alarm threshold configuration

**\[View]**
System view

**\[Use Cases]**

```plaintext
sonic# show snmp-agent threshold
Threshold-Type   Threshold-Value
---------------- -----------------
cpu-usage          80%
memory-usage       80%
```

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

**\[Command]**
**snmp-agent enable**
**no snmp-agent enable**

**\[Purpose]**
Enable SNMP function

**\[View]**
System configure view

**\[Use Cases]**

```plaintext
sonic(config)# snmp-agent enable
```

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

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

```plaintext
sonic(config)# snmp-agent community snmptest
```

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

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

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

### <font color="#1d50a2">snmp-agent trap-target threshold system-usage</font>

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

```plaintext
sonic(config)# snmp-agent trap-target threshold system-usage memory-usage 70
```

### <font color="#1d50a2">snmp-agent trap-target \{1|2|3\}</font>

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

```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 udp-port</font>

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

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

