Network management systems can use SNMP (Simple Network Management Protocol) to monitor network-attached devices for conditions that require administrative attention.
As part of the switch identification process, the controller might use SNMP to obtain more specific information about the switch. SNMP-enabled switches can be configured with community names to provide more secure access.
The Key Service component of the controller allows network administrators to configure SNMP security keys so that the controller can communicate with those switches using the secure key.
To get the SNMP keys known to the controller, enter the following curl command:
curl --header "X-Auth-Token:token
" -sX GET http://controller_ip
:8080/sdn/v2.0/net/keys/SNMP
curl --header "X-Auth-Token: 131eaa225ece4293bcebfd7f8e3cffd0" -sX GET http://localhost:8080/sdn/v2.0/net/keys/SNMP
{ "SNMP": [ "Default SNMP key", "Test Key1", "Test Key2", "Test Key3" ] }
To add one or more SNMP keys to the controller, enter the following curl command:
curl --header "Content-Type: application/json" --header "X-Auth-Token:token
" -sX POST -d @inputfile
http://controller_ip
/sdn/v2.0/net/keys
Where inputfile
is a file in the local directory that contains the key information in JSON format.
curl --header "Content-Type: application/json" --header "X-Auth-Token:18433683aaea4e0782fa632ee9f04953" -sX POST -d @inputfile http://localhost:8080/sdn/v2.0/net/keys
Sample content of inputfile
for an SNMP v1 key
{"key": { "type": "SNMP", "description": "v1Key", "snmp-config": { "snmpversion": "v1", "readcommunityname": "public", "writecommunityname": "public" } } }
Sample content of inputfile
for an SNMP v3 key
{"key": { "type": "SNMP", "description": "authPriv", "snmp-config": { "snmpversion": "v3", "username": "authPriv", "authorization": { "type":"SHA", "password":"MySHApassword" }, "privacy": { "type":"AES", "password":"MyAESpassword" } } } }
To delete an SNMP key from the controller, enter the following curl command:
curl --header "X-Auth-Token:token
" -sX DELETE http://controller_ip
:8080/sdn/v2.0/net/keys/SNMP/description/description
Where description
matches the description for the key you want to delete.
curl --header "X-Auth-Token: 131eaa225ece4293bcebfd7f8e3cffd0" -sX DELETE http://localhost:8080/sdn/v2.0/net/keys/SNMP/description/"authPriv"