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 revision
Previous revision
jq_json_check_mk [2017/04/18 13:13] adminjq_json_check_mk [2021/10/09 15:14] (current) – external edit 127.0.0.1
Line 5: Line 5:
   * Extract all configured hosts from Check_MK and print hostname and folder:<code>   * Extract all configured hosts from Check_MK and print hostname and folder:<code>
 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> 
 +curl "https://<server>/<site>/check_mk/webapi.py?action=get_all_hosts&_username=$user&_secret=$secret"
 +| jq -r '.result[] | [.hostname, .path] | join (";")'
 </code> </code>
jq_json_check_mk.txt · Last modified: 2021/10/09 15:14 by 127.0.0.1