跳转到内容
Ask AI

SNMP-Netconf

此内容尚不支持你的语言。

YANG Pathget/get-configedit-configrpc
/snmpYmerge, replace, create, delete—
/snmp/globalYmerge, replace, create, delete—
/snmp/snmp-communities/{community-name}Ymerge, replace, create, delete—
/snmp/snmp-sources/{source-ip}/{udp-port}/{vrf-name}Ymerge, replace, create, delete—
/snmp/snmp-traps/{trap-type}Ymerge, replace, create, delete—
/snmp/snmp-users/{user-name}Ymerge, replace, create, delete—
/snmp/system-usage-thresholdYmerge, replace, create, delete—

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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? uint16

Table of Properties

NameRequiredType/RangeDescription
snmpO

Tree Diagram

module: asternos-snmp
+--rw snmp
+--rw global
+--rw enabled? boolean

Table of Properties

NameRequiredType/RangeDescription
globalMPath-only node, has no configurable value.
SNMP global configuration.
enabledO”true"
"false”
startup or stop SNMP docker container.
Default value: False

Tree Diagram

module: asternos-snmp
+--rw snmp
+--rw snmp-communities
+--rw snmp-community* [community-name]
+--rw community-name string
+--rw community-permission? enumeration

Table of Properties

NameRequiredType/RangeDescription
snmp-communitiesMPath-only node, has no configurable value.
SNMP agent communities list.
snmp-communityMPath-only node, has no configurable value.
SNMP agent community configuration.
community-nameOstring (length 1..32)SNMP agent community name, ‘public’ is the default value.
community-permissionO”RO"
"RW”
permission of the snmp community.
Default value: RO

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-ref

Table of Properties

NameRequiredType/RangeDescription
snmp-sourcesMPath-only node, has no configurable value.
SNMP agent sources list.
snmp-sourceMPath-only node, has no configurable value.
SNMP agent source configuration.
source-ipOinet:ip-address-no-zone
udp-portO0..65535Set snmp source udp port, default: 161
vrf-nameOvrf:vrf-refSet snmp source vrf, default: default(if use default, will set ” in CONFIG_DB)

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 string

Table of Properties

NameRequiredType/RangeDescription
snmp-trapsMPath-only node, has no configurable value.
SNMP agent traps list.
snmp-trapMPath-only node, has no configurable value.
SNMP agent trap configuration.
trap-typeO”v1"
"v2c"
"v3”
SNMP agent trap type.
trap-ipMinet:ip-address-no-zoneSNMP agent trap ip address.
vrf-nameOvrf:vrf-refSet snmp trap vrf
udp-portO0..65535SNMP agent trap udp port, default: 162
Default value: 162
community-nameOstringSNMP agent trap community name.
user-nameMstringSNMP agent trap user name.

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? enumeration

Table of Properties

NameRequiredType/RangeDescription
snmp-usersMPath-only node, has no configurable value.
SNMP agent users list.
snmp-userMPath-only node, has no configurable value.
SNMP agent user configuration
user-nameOstring (length 1..32)
authen-modeO”MD5"
"SHA”
Enables authentication of the user.
authen-keyMletters, digits, underscores, or hyphensThe key used in MD5 or SHA based authentication algorithms for user authentication.
privacy-modeO”DES"
"AES”
Enables privacy related configuration of the user.
privacy-keyMletters, digits, underscores, or hyphensA secret key used by the DES or AES based encryption algorithm for authentication password.
user-typeO”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)
permissionO”RO"
"RW”
permission of the snmp user agent.
Default value: RO

Tree Diagram

module: asternos-snmp
+--rw snmp
+--rw system-usage-threshold
+--rw cpu-usage? uint16
+--rw memory-usage? uint16

Table of Properties

NameRequiredType/RangeDescription
system-usage-thresholdMPath-only node, has no configurable value.
SNMP system usage threshold configuration.
cpu-usageO0..100when cpu usage up to the threshold, the overload msg will be trapped
Default value: 80
memory-usageO0..100when memory usage up to the threshold, the overload msg will be trapped
Default value: 80