This section describes how to configure the SNMP version, SNMP agent engine ID, and other functions using the rpc method.
Operation |
XPATH |
|---|---|
rpc |
|
Item |
Data |
Description |
|---|---|---|
Whether to enable the SNMP agent function on a switch |
true |
Enable the SNMP agent function on a switch. |
Name of the switch |
test |
Set the switch name to test. |
IP address of the switch |
10.1.1.1 |
Set the IP address of the switch to 10.1.1.1. |
UDP port that the NMS users to communicate with the switch |
2000 |
Set the UDP port that the NMS users to communicate with the switch to 2000. |
SNMP version enabled on the switch |
v1 |
Enable SNMPv1 on the switch. |
SNMP agent engine ID |
80:00:07:DB:03:00:01:00:02:00:B1 |
Set the SNMP agent engine ID to 80:00:07:DB:03:00:01:00:02:00:B1. |
<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="4" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<edit-config>
<target>
<running/>
</target>
<config>
<snmp:snmp xmlns:snmp="urn:ietf:params:xml:ns:yang:ietf-snmp">
<snmp:engine>
<snmp:enabled>true</snmp:enabled>
<snmp:listen>
<snmp:name>test</snmp:name>
<snmp:udp>
<snmp:ip>10.1.1.1</snmp:ip>
<snmp:port>2000</snmp:port>
</snmp:udp>
</snmp:listen>
<snmp:version>
<snmp:v1></snmp:v1>
</snmp:version>
<snmp:engine-id>80:00:07:DB:03:00:01:00:02:00:B1</snmp:engine-id>
</snmp:engine>
</snmp:snmp>
</config>
</edit-config>
</rpc>
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="4"> <ok/> </rpc-reply>
<?xml version='1.0' encoding='UTF-8'?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="4">
<rpc-error>
<error-app-tag>-1</error-app-tag>
<error-message>Service process failed.</error-message>
<error-info>Error on node/ietf-snmp:snmp/engine/enabled</error-info>
</rpc-error>
</rpc-reply>