SNMP-Netconf
Resources Summary
Section titled “Resources Summary”| YANG Path | get/get-config | edit-config | rpc |
|---|---|---|---|
| /snmp | Y | merge, replace, create, delete | — |
| /snmp/global | Y | merge, replace, create, delete | — |
| /snmp/snmp-communities/{community-name} | Y | merge, replace, create, delete | — |
| /snmp/snmp-sources/{source-ip}/{udp-port}/{vrf-name} | Y | merge, replace, create, delete | — |
| /snmp/snmp-traps/{trap-type} | Y | merge, replace, create, delete | — |
| /snmp/snmp-users/{user-name} | Y | merge, replace, create, delete | — |
| /snmp/system-usage-threshold | Y | merge, replace, create, delete | — |
Examples
Section titled “Examples”Enable Feature SNMP
Section titled “Enable Feature SNMP”Request example to enable SNMP service via edit-config
<config> <top> <snmp> <global operation="create"> <enabled>true</enabled> </global> </snmp> </top></config>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:7585073b-5463-434e-926f-368243ff7983"> <ok/></rpc-reply>Disable Feature SNMP
Section titled “Disable Feature SNMP”Request example to disable SNMP service via edit-config
<config> <top> <snmp> <global operation="delete"/> </snmp> </top></config>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:b7207c0e-17c2-4e13-99bc-f2c2eaa6108b"> <ok/></rpc-reply>Get SNMP Gloabl Configurations
Section titled “Get SNMP Gloabl Configurations”Request example to get SNMP global configurations via edit-config
<filter type="subtree"> <top xmlns="http://asterfusion.com/ns/yang/asternos-interfaces"> <snmp> <global/> </snmp> </top></filter>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:8e0d19dd-780c-4ee9-b469-b5bc771669e7"> <data> <top> <snmp xmlns="http://asterfusion.com/ns/yang/asternos-snmp"> <global> <enabled>false</enabled> </global> </snmp> </top> </data></rpc-reply>Create SNMP Community
Section titled “Create SNMP Community”Request example to create SNMP community via edit-config
<config> <top> <snmp> <snmp-communities> <snmp-community> <community-name>test</community-name> <community-permission>RO</community-permission> </snmp-community> </snmp-communities> </snmp> </top></config>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:ab57b60c-92da-4959-8232-278e60114589"> <ok/></rpc-reply>Get SNMP Community
Section titled “Get SNMP Community”Request example to create SNMP community via edit-config
<filter type="subtree"> <top> <snmp> <snmp-communities/> </snmp> </top></filter>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:9da7fdfc-2faa-41ac-bd2b-e551583fbf24"> <data> <top> <snmp xmlns="http://asterfusion.com/ns/yang/asternos-snmp"> <snmp-communities> <snmp-community> <community-name>test</community-name> <community-permission>RO</community-permission> </snmp-community> </snmp-communities> </snmp> </top> </data></rpc-reply>Delete SNMP Community
Section titled “Delete SNMP Community”Request example to delete SNMP community via edit-config
<config> <top> <snmp> <snmp-communities> <snmp-community operation="delete"> <community-name>test</community-name> </snmp-community> </snmp-communities> </snmp> </top></config>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:36e810cd-d456-4c3f-a142-a827c0feb642"> <ok/></rpc-reply>Create SNMP User
Section titled “Create SNMP User”Request example to create SNMP user via edit-config
<config> <top> <snmp> <snmp-users> <snmp-user operation="create"> <user-name>test1</user-name> <authen-mode>MD5</authen-mode> <authen-key>12345678</authen-key> <privacy-mode>DES</privacy-mode> <privacy-key>87654321</privacy-key> <user-type>Priv</user-type> <permission>RW</permission> </snmp-user> </snmp-users> </snmp> </top></config>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:7f77db16-1780-403e-8aa7-02af36849a18"> <ok/></rpc-reply>Get SNMP User
Section titled “Get SNMP User”Request example to get SNMP user via get-config
<filter type="subtree"> <top> <snmp> <snmp-users/> </snmp> </top></filter>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:11dc90c3-74dc-4fb2-bf1b-ddf4b77d9d1e"> <data> <top> <snmp xmlns="http://asterfusion.com/ns/yang/asternos-snmp"> <snmp-users> <snmp-user> <user-name>test1</user-name> <authen-mode>MD5</authen-mode> <authen-key>12345678</authen-key> <privacy-mode>DES</privacy-mode> <privacy-key>87654321</privacy-key> <user-type>Priv</user-type> <permission>RW</permission> </snmp-user> </snmp-users> </snmp> </top> </data></rpc-reply>Delete SNMP user
Section titled “Delete SNMP user”Request example to delete specified SNMP user via edit-config
<config><top> <snmp> <snmp-users> <snmp-user operation="delete"> <user-name>test1</user-name> </snmp-user> </snmp-users> </snmp></top></config>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:570036c1-7e0a-4bd9-9ece-25f720f46464"> <ok/></rpc-reply>Create SNMP Source
Section titled “Create SNMP Source”Request example to create SNMP source configurations via edit-config
<config> <top> <snmp> <snmp-sources> <snmp-source operation="create"> <source-ip>192.168.18.148</source-ip> <udp-port>165</udp-port> <vrf-name>default</vrf-name> </snmp-source> </snmp-sources> </snmp> </top></config>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:ee179679-8b00-4fb0-9cc1-85db9969428f"> <ok/></rpc-reply>Get SNMP Source
Section titled “Get SNMP Source”Request example to get SNMP source configurations via get-config
<filter type="subtree"> <top xmlns="http://asterfusion.com/ns/yang/asternos-interfaces"> <snmp> <snmp-sources/> </snmp> </top></filter>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:7d19a01e-80f0-4092-9ff3-0f2bc0371dfb"> <data> <top> <snmp xmlns="http://asterfusion.com/ns/yang/asternos-snmp"> <snmp-sources> <snmp-source> <source-ip>192.168.18.148</source-ip> <udp-port>165</udp-port> <vrf-name>default</vrf-name> </snmp-source> </snmp-sources> </snmp> </top> </data></rpc-reply>Delete SNMP Source
Section titled “Delete SNMP Source”Request example to delete specified SNMP source configurations via edit-config
<config> <top> <snmp> <snmp-sources> <snmp-source operation="delete"> <source-ip>192.168.18.148</source-ip> <udp-port>165</udp-port> <vrf-name>default</vrf-name> </snmp-source> </snmp-sources> </snmp> </top></config>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:da88117c-7f15-4eef-a427-19c123a2efd2"> <ok/></rpc-reply>Create SNMP Trap
Section titled “Create SNMP Trap”Request example to create SNMP trap via edit-config
<config> <top> <snmp> <snmp-traps> <snmp-trap operation="create"> <trap-type>v2c</trap-type> <trap-ip>192.168.18.148</trap-ip> <community-name>test</community-name> </snmp-trap> </snmp-traps> </snmp> </top></config>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:60161aa1-60e3-4fb8-9451-37bd228a5c00"> <ok/></rpc-reply>Get SNMP Trap
Section titled “Get SNMP Trap”Request example to get SNMP trap via get-config
<filter type="subtree"> <top> <snmp> <snmp-traps/> </snmp> </top></filter>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:60a4b0f8-9387-42ba-863a-86fa7ad61916"> <data> <top> <snmp xmlns="http://asterfusion.com/ns/yang/asternos-snmp"> <snmp-traps> <snmp-trap> <trap-type>v2c</trap-type> <trap-ip>192.168.18.148</trap-ip> <udp-port>162</udp-port> <community-name>test</community-name> </snmp-trap> </snmp-traps> </snmp> </top> </data></rpc-reply>Delete SNMP Trap
Section titled “Delete SNMP Trap”Request example to delete SNMP trap via edit-config
<config> <top> <snmp> <snmp-traps> <snmp-trap operation="delete"> <trap-type>v2c</trap-type> </snmp-trap> </snmp-traps> </snmp> </top></config>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:b43a9004-f6aa-481b-b935-a4053fca7f38"> <ok/></rpc-reply>Create SNMP Threshold
Section titled “Create SNMP Threshold”Request example to create SNMP threshold via edit-config
<config> <top> <snmp> <system-usage-threshold operation="create"> <cpu-usage>66</cpu-usage> <memory-usage>77</memory-usage> </system-usage-threshold> </snmp> </top></config>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:2f4a2114-666d-4d56-a8b4-88cefc9cea4b"> <ok/></rpc-reply>Get SNMP Threshold
Section titled “Get SNMP Threshold”Request example to get SNMP threshold via get-config
<filter type="subtree"> <top> <snmp> <system-usage-threshold/> </snmp> </top></filter>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:e66cf9e8-79ee-460d-8d45-6cb2fb3fb647"> <data> <top> <snmp xmlns="http://asterfusion.com/ns/yang/asternos-snmp"> <system-usage-threshold> <cpu-usage>66</cpu-usage> <memory-usage>77</memory-usage> </system-usage-threshold> </snmp> </top> </data></rpc-reply>Delete SNMP Threshold
Section titled “Delete SNMP Threshold”Request example to delete SNMP threshold via edit-config
<config> <top> <snmp> <system-usage-threshold operation="delete"/> </snmp> </top></config>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:81d1167a-6253-490e-b583-0c9f64ad09ad"> <ok/></rpc-reply>Properties Descriptions
Section titled “Properties Descriptions”Tree Diagram
module: asternos-snmp +--rw snmp +--rw global | +--rw enabled? boolean +--rw snmp-communities | +--rw snmp-community* [community-name] | +--rw community-name string | +--rw community-permission? enumeration +--rw snmp-users | +--rw snmp-user* [user-name] | +--rw user-name string | +--rw authen-mode? enumeration | +--rw authen-key string | +--rw privacy-mode? enumeration | +--rw privacy-key string | +--rw user-type? enumeration | +--rw permission? enumeration +--rw snmp-sources | +--rw snmp-source* [source-ip udp-port vrf-name] | +--rw source-ip inet:ip-address-no-zone | +--rw udp-port uint16 | +--rw vrf-name vrf:vrf-ref +--rw snmp-traps | +--rw snmp-trap* [trap-type] | +--rw trap-type enumeration | +--rw trap-ip inet:ip-address-no-zone | +--rw vrf-name? vrf:vrf-ref | +--rw udp-port? uint16 | +--rw community-name? string | +--rw user-name string +--rw system-usage-threshold +--rw cpu-usage? uint16 +--rw memory-usage? uint16Table of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| snmp | O |
SNMP global configuration
Section titled “SNMP global configuration”Tree Diagram
module: asternos-snmp +--rw snmp +--rw global +--rw enabled? booleanTable of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| global | M | Path-only node, has no configurable value. SNMP global configuration. | |
| enabled | O | ”true" "false” | startup or stop SNMP docker container. Default value: False |
SNMP agent communities list
Section titled “SNMP agent communities list”Tree Diagram
module: asternos-snmp +--rw snmp +--rw snmp-communities +--rw snmp-community* [community-name] +--rw community-name string +--rw community-permission? enumerationTable of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| snmp-communities | M | Path-only node, has no configurable value. SNMP agent communities list. | |
| snmp-community | M | Path-only node, has no configurable value. SNMP agent community configuration. | |
| community-name | O | string (length 1..32) | SNMP agent community name, ‘public’ is the default value. |
| community-permission | O | ”RO" "RW” | permission of the snmp community. Default value: RO |
SNMP agent sources list
Section titled “SNMP agent sources list”Tree Diagram
module: asternos-snmp +--rw snmp +--rw snmp-sources +--rw snmp-source* [source-ip udp-port vrf-name] +--rw source-ip inet:ip-address-no-zone +--rw udp-port uint16 +--rw vrf-name vrf:vrf-refTable of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| snmp-sources | M | Path-only node, has no configurable value. SNMP agent sources list. | |
| snmp-source | M | Path-only node, has no configurable value. SNMP agent source configuration. | |
| source-ip | O | inet:ip-address-no-zone | |
| udp-port | O | 0..65535 | Set snmp source udp port, default: 161 |
| vrf-name | O | vrf:vrf-ref | Set snmp source vrf, default: default(if use default, will set ” in CONFIG_DB) |
SNMP agent traps list
Section titled “SNMP agent traps list”Tree Diagram
module: asternos-snmp +--rw snmp +--rw snmp-traps +--rw snmp-trap* [trap-type] +--rw trap-type enumeration +--rw trap-ip inet:ip-address-no-zone +--rw vrf-name? vrf:vrf-ref +--rw udp-port? uint16 +--rw community-name? string +--rw user-name stringTable of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| snmp-traps | M | Path-only node, has no configurable value. SNMP agent traps list. | |
| snmp-trap | M | Path-only node, has no configurable value. SNMP agent trap configuration. | |
| trap-type | O | ”v1" "v2c" "v3” | SNMP agent trap type. |
| trap-ip | M | inet:ip-address-no-zone | SNMP agent trap ip address. |
| vrf-name | O | vrf:vrf-ref | Set snmp trap vrf |
| udp-port | O | 0..65535 | SNMP agent trap udp port, default: 162 Default value: 162 |
| community-name | O | string | SNMP agent trap community name. |
| user-name | M | string | SNMP agent trap user name. |
SNMP agent users list
Section titled “SNMP agent users list”Tree Diagram
module: asternos-snmp +--rw snmp +--rw snmp-users +--rw snmp-user* [user-name] +--rw user-name string +--rw authen-mode? enumeration +--rw authen-key string +--rw privacy-mode? enumeration +--rw privacy-key string +--rw user-type? enumeration +--rw permission? enumerationTable of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| snmp-users | M | Path-only node, has no configurable value. SNMP agent users list. | |
| snmp-user | M | Path-only node, has no configurable value. SNMP agent user configuration | |
| user-name | O | string (length 1..32) | |
| authen-mode | O | ”MD5" "SHA” | Enables authentication of the user. |
| authen-key | M | letters, digits, underscores, or hyphens | The key used in MD5 or SHA based authentication algorithms for user authentication. |
| privacy-mode | O | ”DES" "AES” | Enables privacy related configuration of the user. |
| privacy-key | M | letters, digits, underscores, or hyphens | A secret key used by the DES or AES based encryption algorithm for authentication password. |
| user-type | O | ”noAuthNoPriv" "AuthNoPriv" "Priv” | The Authentication type, which contain 3 ways, noAuthNoPriv(no key) and AuthNoPriv(only auth key) and Priv(both auth and priv keys) |
| permission | O | ”RO" "RW” | permission of the snmp user agent. Default value: RO |
SNMP system usage threshold configuration
Section titled “SNMP system usage threshold configuration”Tree Diagram
module: asternos-snmp +--rw snmp +--rw system-usage-threshold +--rw cpu-usage? uint16 +--rw memory-usage? uint16Table of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| system-usage-threshold | M | Path-only node, has no configurable value. SNMP system usage threshold configuration. | |
| cpu-usage | O | 0..100 | when cpu usage up to the threshold, the overload msg will be trapped Default value: 80 |
| memory-usage | O | 0..100 | when memory usage up to the threshold, the overload msg will be trapped Default value: 80 |