TECHZEN Zenoss User Community ARCHIVE  

REST API - Export CPU/Memory usage

Subject: REST API - Export CPU/Memory usage
Author: ema lo
Posted: 2017-12-19 03:47

Hello world,

I need to export CPU/Memory usage of all servers from Zenoss Monitoring with REST API.
Reading the documentation I do not found nothing.

Can anyone help me?
Regards

------------------------------
ema
------------------------------


Subject: RE: REST API - Export CPU/Memory usage
Author: ema lo
Posted: 2017-12-21 03:28

Hello,

I resolved with the following REST API:

curl -v -u "<username>:<password>" -X POST -d @Body_zenoss.json -H "Content-Type:application/json" "https://<url>/api/performance/query" --insecure --noproxy '*' > F:\zenoss_export.json

With the following file "Body_zenoss.json" (derived by using my browser developer tools to look at the request headers for a query.js call when looking at a graph of the data I am interested in):

{"start":1513771769405,"end":1513775369405,"series":true,"downsample":"10s-avg","tags":{},"returnset":"EXACT","metrics":[{"metric":"<DeviceName>/MemoryAvailableBytes_MemoryAvailableBytes","id":"bEpRaO1Upb","rate":false,"rateOptions":{},"aggregator":"avg","tags":{"key":["Devices/<DeviceName>"]},"name":"Available"},{"metric":"<DeviceName>/MemoryCommittedBytes_MemoryCommittedBytes","id":"7DR2nteLkK","rate":false,"rateOptions":{},"aggregator":"avg","tags":{"key":["Devices/<DeviceName>"]},"name":"Committed"}]}

Now I want to find the REST API to export CPU/Memory usage for all devices monitored (latest value only).
Can anyone help me?

Regards,
ema


------------------------------
ema
------------------------------


< Previous
Adding Locations to a ZenPack?
  Next
Monitoring Templates extraction
>