---
title: SNMP
slug: aidc/Lgmu-snmp
createdAt: 2025-12-29T10:35:14.971Z
---

##

| **URL**                                                                        | **GET** | **POST** | **PATCH** | **PUT** | **DELETE** |
| ------------------------------------------------------------------------------ | ------- | -------- | --------- | ------- | ---------- |
| /rest/v1/running/snmp-communities/&#x7B;community-name}                        | Y       | Y        | N         | N       | Y          |
| /rest/v1/running/snmp-sources/&#x7B;source-ip}/&#x7B;udp-port}/&#x7B;vrf-name} | Y       | Y        | N         | N       | Y          |
| /rest/v1/running/snmp-traps/&#x7B;trap-type}                                   | Y       | N        | N         | Y       | Y          |
| /rest/v1/running/snmp-users/&#x7B;user-name}                                   | Y       | Y        | N         | N       | Y          |

## <font color="#1d50a2">Examples</font>

### <font color="#1d50a2">Create a SNMP community</font>

```json
POST  HTTPS://{switch IP}/rest/v1/running/snmp-communities
{
    "community-name": "test"
}
```

### <font color="#1d50a2">Create an SNMP source</font>

```json
POST HTTPS://{switch IP}/rest/v1/running/snmp-sources
{
    "source-ip": "10.0.0.100",
    "udp-port": "162",
    "vrf-name": "default"
}
```

### <font color="#1d50a2">Replace a SNMP trap</font>

```json
PUT HTTPS://{switch IP}/rest/v1/running/snmp-traps/v2c
{
    "trap-ip": "10.50.1.2",
    "udp-port": 163,
    "vrf-name": "Vrftest1",
    "community-name": "default"
}
```

### <font color="#1d50a2">Create a SNMP user</font>

```json
POST rest/v1/running/snmp-users
{
    "user-name": "test3",
    "authen-mode": "SHA",
    "authen-key": "123456789",
    "privacy-mode": "AES",
    "privacy-key": "987654321"
}
```

## <font color="#1d50a2">Properties Descriptions</font>

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

**Tree Diagrams**

```plaintext
  +--rw snmp-communities
  |  +--rw snmp-community* [community-name]
  |     +--rw community-name
```

**Table of Properties**

| **Name**         | **Required** | **Type/Range** | **Description**                                                                                                                               |
| ---------------- | ------------ | -------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| snmp-communities | M            |                | Path-only node, has no configurable value.                                                                                                    |
| community-name   | M            | string         | (sub-property of snmp-communities)<br />SNMP agent community configuration, "public" is the default value and is not allowed to be configured |

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

**Tree Diagrams**

```plaintext
  +--rw snmp-users
  |  +--rw snmp-user* [user-name]
  |     +--rw user-name
  |     +--rw authen-mode?
  |     +--rw authen-key
  |     +--rw privacy-mode?
  |     +--rw privacy-key
  |     +--ro user-type?
```

**Table of Properties**

| **Name**     | **Required** | **Type/Range**                                                              | **Description**                                                                                                                                                       |
| ------------ | ------------ | --------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| snmp-users   | M            |                                                                             | Path-only node, has no configurable value.                                                                                                                            |
| user-name    | M            | string                                                                      | (sub-property of snmp-users)                                                                                                                                          |
| authen-mode  | O            | "MD5"<br />"SHA"                                                            | (sub-property of snmp-users)<br />Enables authentication of the user.                                                                                                 |
| authen-key   | CM           | a string of letters, digits, underscores, or hyphens (0 or more characters) | (sub-property of snmp-users)<br />Only applicable when authen-mode.<br />The key used in MD5 or SHA based authentication algorithms for user authentication.          |
| privacy-mode | CO           | "DES"<br />"AES"                                                            | (sub-property of snmp-users)<br />Only applicable when authen-mode.<br />Enables privacy of the user.                                                                 |
| privacy-key  | CM           | a string of letters, digits, underscores, or hyphens (0 or more characters) | (sub-property of snmp-users)<br />Only applicable when privacy-mode.<br />A secret key used by the DES or AES based encryption algorithm for authentication password. |
| user-type    | RO           | "noAuthNoPriv"<br />"AuthNoPriv"<br />"Priv"                                | (sub-property of snmp-users)                                                                                                                                          |

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

**Tree Diagrams**

```plaintext
  +--rw snmp-sources
  |  +--rw snmp-source* [source-ip udp-port vrf-name]
  |     +--rw source-ip
  |     +--rw udp-port
  |     +--rw vrf-name
```

**Table of Properties**

| **Name**     | **Required** | **Type/Range**                              | **Description**                                                                                                      |
| ------------ | ------------ | ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| snmp-sources | M            |                                             | Path-only node, has no configurable value.                                                                           |
| source-ip    | M            | A.B.C.D<br />XX\:XX\:XX\:XX\:XX\:XX\:XX\:XX | (sub-property of snmp-sources)                                                                                       |
| udp-port     | M            | 0..65535                                    | (sub-property of snmp-sources)<br />Set snmp source udp port, default: 161                                           |
| vrf-name     | M            | "default"<br />vrf name                     | (sub-property of snmp-sources)<br />Set snmp source vrf, default: default(if use default, will set '' in CONFIG\_DB) |

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

**Tree Diagrams**

```plaintext
  +--rw snmp-traps
     +--rw snmp-trap* [trap-type]
        +--rw trap-type
        +--rw trap-ip
        +--rw vrf-name?
        +--rw udp-port?
        +--rw community-name?
        +--rw user-name
```

**Table of Properties**

| **Name**       | **Required** | **Type/Range**                              | **Description**                                                                               |
| -------------- | ------------ | ------------------------------------------- | --------------------------------------------------------------------------------------------- |
| snmp-traps     | M            |                                             | Path-only node, has no configurable value.                                                    |
| trap-type      | M            | "v1"<br />"v2c"<br />"v3"                   | (sub-property of snmp-traps)                                                                  |
| trap-ip        | M            | A.B.C.D<br />XX\:XX\:XX\:XX\:XX\:XX\:XX\:XX | (sub-property of snmp-traps)                                                                  |
| vrf-name       | O            | "default"<br />vrf name                     | (sub-property of snmp-traps)                                                                  |
| udp-port       | O            | 0..65535                                    | (sub-property of snmp-traps)<br />Default value: 162                                          |
| community-name | CO           | string                                      | (sub-property of snmp-traps)<br />Only applicable when trap-type = "v1" or trap-type = "v2c". |
| user-name      | CM           | string                                      | (sub-property of snmp-traps)<br />Only applicable when trap-type = "v3".                      |

