Ben's notes

Linux, Unix, network, radio...

User Tools

Site Tools


jq_json_check_mk

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
jq_json_check_mk [2017/04/18 13:16] – [jq - Command-line JSON processor / Check_MK] adminjq_json_check_mk [2017/04/18 13:30] – [jq - Command-line JSON processor / Check_MK] admin
Line 6: Line 6:
 curl "https://<server>/<site>/check_mk/webapi.py?action=get_all_hosts&_username=$user&_secret=$secret" \ curl "https://<server>/<site>/check_mk/webapi.py?action=get_all_hosts&_username=$user&_secret=$secret" \
 | jq '.result[] | {hostname: .hostname, path: .path}' | jq '.result[] | {hostname: .hostname, path: .path}'
 +</code> 
 +  * Extract CSV:<code> 
 +| jq -r '.[] | map([.hostname, .path] | join (", ")) | join ("\n")' 
 </code> </code>
jq_json_check_mk.txt · Last modified: 2021/10/09 15:14 by 127.0.0.1