TECHZEN Zenoss User Community ARCHIVE  

Json API get zProperty zCommandPassword

Subject: Json API get zProperty zCommandPassword
Author: Miguel Angel Perez Cantu
Posted: 2018-05-23 14:34

Hi

I need to know how get zCommandPassword via JSONAPI, actually i get all zProperties but password is mask (I supposed cause is type: password)

Example with zProperty zCommandUsername
Command:
zenoss_api properties_router PropertiesRouter getZenProperty '{"uid": "/zport/dmd/Devices/Network/Cisco/ASA/devices/192.168.201.35", "zProperty": "zCommandUsername"}'

Result:
{"uuid": "378031ed-c216-4e38-ad75-32f5761ca762", "action": "PropertiesRouter", "result": {"data": {"path": "/Network/Cisco/ASA/devices/192.168.201.35", "type": "string", "options": [], "value": "itoc_rancid", "valueAsString": "itoc_rancid"}, "success": true}, "tid": 1, "type": "rpc", "method": "getZenProperty"}[root@MXAP-BOITOC01 script_Zenoss_Enriquece]#

Example with zProperty zCommandPassword

Command:
zenoss_api properties_router PropertiesRouter getZenProperty '{"uid": "/zport/dmd/Devices/Network/Cisco/ASA/devices/192.168.201.35", "zProperty": "zCommandPassword"}'

Result:
{"uuid": "1c92a03f-f7e3-40ad-80f4-a48017d7b283", "action": "PropertiesRouter", "result": {"data": {"path": "/Network/Cisco/ASA/devices/192.168.201.35", "type": "password", "options": []}, "success": true}, "tid": 1, "type": "rpc", "method": "getZenProperty"}You have mail in /var/spool/mail/root


------------------------------
Miguel Angel Perez Cantu
------------------------------


Subject: RE: Json API get zProperty zCommandPassword
Author: Jay Stanley
Posted: 2018-06-28 12:30

You cannot, because it is a password. And that would be a security flaw if you could.

You can get it using zendmd.

------------------------------
jstanley
------------------------------


< Previous
Calculated Performance between two devices metrics
  Next
Issues With Microsoft Windows Zenpack 2.9 on Zenoss 4.2.5
>