Proxmox VE API - parsing JSON response

cipherr

Member
Jan 12, 2022
5
0
6
59
Hello,

I am trying to create single script to check the CEPH health status, i managed out how to get JSON response with all details i need, but i cannot understand how should i parse it to get following info:
Screenshot 2022-06-01 at 10.50.35.png


Can you point me to right direction or any tutorial? Is that nested JSON?

All i can do at this moment is to get "data" key, but i have no clue how to get the "status" message from the "health" key (i assume it is key as well?)



I use this API url for JSON response - https://server:8006/api2/json/cluster/ceph/status


I am total beginner, i would be thankful for every output from you.

Thank you in advance.
 
you could use jq , e.g like this: pvesh get /cluster/ceph/status --output-format json | jq .health.status