Working with the JSON API

From Zenoss Wiki
Revision as of 03:12, 25 November 2012 by Chet Luther (Talk | contribs)$7

(diff) ← Older revision | Approved revision (diff) | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

You can find API documentation for the Zenoss JSON API at The accompanying files for this document include a shell script called This is an example for using curl in a shell script to use the Zenoss JSON API.

The following example uses helper functions in to show the title and URL for the graphs on a particular device. Be sure to download for this example.

$ # Get the zenoss_api function by sourcing
$ source

$ # Call the getGraphDefs method.
$ zenoss_api device_router DeviceRouter getGraphDefs '{"uid":"/zport/dmd/Devices/Server/Linux/devices/","drange":129600}'

The output of this command will be a JSON document that contains the title and graph URL for every graph on the device identified by the uid parameter above.