This section describes how to configure an NMS to manage switches 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 an NMS |
test |
Set the NMS name to test. |
IP address of the NMS |
10.1.1.1 |
Set the IP address of the NMS to 10.1.1.1. |
UDP port that the switch uses to communicate with the NMS |
50 |
Set UDP port that the switch uses to communicate with the NMS to 50. |
Name of the SNMP parameter set on the NMS |
abc |
Configure the SNMP parameter set abc on the NMS. |
User security name displayed on the NMS when the switch and NMS communicate using SNMPv3 |
abcd |
Set the user security name displayed on the NMS when the switch and NMS communicate using SNMPv3 to abcd. |
Security level of an SNMPv3 user security name |
auth-priv |
Set the security level of an SNMPv3 user security name to auth-priv which indicates that the user security name needs to be authenticated and encrypted. |
Name of a filter profile applied to the NMS |
test_profile |
Apply the trap filter profile test_profile to the NMS. |
MIB subtree that can be accessed by a filter profile |
1.3.6.1.4.1.2011.5.2.1.1.1.2 |
Set the MIB subtree that can be accessed by a trap filter profile to 1.3.6.1.4.1.2011.5.2.1.1.1.2. |
MIB subtree that cannot be accessed by a filter profile |
1.3.6.1.4.1.2011.5.2.1.1.1.3 |
Set the MIB subtree that cannot be accessed by a trap filter profile to 1.3.6.1.4.1.2011.5.2.1.1.1.3. |
<?xml version='1.0' encoding='UTF-8'?> <rpc message-id="5" 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:engine> <snmp:target> <snmp:name>test</snmp:name> <snmp:udp> <snmp:ip>10.1.1.1</snmp:ip> <snmp:port>50</snmp:port> </snmp:udp> <snmp:target-params>abc</snmp:target-params> </snmp:target> <snmp:target-params> <snmp:name>abc</snmp:name> <snmp:usm> <snmp:user-name>abcd</snmp:user-name> <snmp:security-level>auth-priv</snmp:security-level> </snmp:usm> <snmp:notify-filter-profile>test_profile</snmp:notify-filter-profile> </snmp:target-params> <snmp:notify-filter-profile> <snmp:name>test_profile</snmp:name> <snmp:include>1.3.6.1.4.1.2011.5.2.1.1.1.2</snmp:include> <snmp:exclude>1.3.6.1.4.1.2011.5.2.1.1.1.3</snmp:exclude> </snmp:notify-filter-profile> </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="5"> <ok/> </rpc-reply>
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="5"> <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>