It looks like your JSON object isn't formatted correctly. I just did it in the browser and captured the output in Firefox's developer tools:
Try this: {"uid":"/zport/dmd/Devices/Network/Cisco/Nexus/7000/devices/Test7k","zProperty":"zSnmpAuthType","value":"MD5"}
Sr. Manager, Customer Enablement
Subject: |
RE: API change zparemeter fails |
Author: |
Chris De Coster |
Posted: |
2019-05-08 07:24 |
Hi,
I was able to make it work with the following script:
#!/bin/ksh
ZENOSS_URL="https://zenoss.url:8080"
ZENOSS_USERNAME="user"
ZENOSS_PASSWORD="Pasword"
DEVICE_HOSTNAME=$1
DEVICE_CLASS="Network/Cisco/Nexus/7000/DCI-COLF/devices"
COLLECTOR="localhost"
ROUTER_ACTION="PropertiesRouter"
ROUTER_METHOD="setZenProperty"
ROUTER_ENDPOINT="properties_router"
DATA="{\"uid\":\"/zport/dmd/Devices/$DEVICE_CLASS/$DEVICE_HOSTNAME\", \"zProperty\":\"zSnmpAuthType\",\"value\":\"MD5\"}"
curl -s \
-w "\n" \
-k \
-u "$ZENOSS_USERNAME:$ZENOSS_PASSWORD" \
-X POST \
-H "Content-Type: application/json" \
-d "{\"action\":\"$ROUTER_ACTION\",\"method\":\"$ROUTER_METHOD\",\"data\":[$DATA], \"type\":\"rpc\", \"tid\":1}" \
"$ZENOSS_URL/zport/dmd/$ROUTER_ENDPOINT"\
|grep success --color=auto
Thanks a lot to point me in the right direction !
------------------------------
Chris De Coster
------------------------------