Warning: session_start(): open(/tmp/sess_72709a0a1053873b51b173882e9c06ec, O_RDWR) failed: No space left on device (28) in /var/www/html/inc/init.php on line 265

Warning: session_start(): Failed to read session data: files (path: ) in /var/www/html/inc/init.php on line 265
Writing /var/www/html/data/log/error/2024-06-17.log failed

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/inc/init.php:265) in /var/www/html/inc/auth.php on line 432
Writing /var/www/html/data/log/error/2024-06-17.log failed

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/inc/init.php:265) in /var/www/html/inc/actions.php on line 38
jq_json_check_mk [Ben's notes]

Ben's notes

Linux, Unix, network, radio...

User Tools

Site Tools


jq_json_check_mk

jq - Command-line JSON processor / Check_MK

  • Extract all configured hosts from Check_MK and print hostname and folder:
    curl "https://<server>/<site>/check_mk/webapi.py?action=get_all_hosts&_username=$user&_secret=$secret" \
    | jq '.result[] | {hostname: .hostname, path: .path}'
  • Extract CSV:
    curl "https://<server>/<site>/check_mk/webapi.py?action=get_all_hosts&_username=$user&_secret=$secret" \
    | jq -r '.result[] | [.hostname, .path] | join (";")'
jq_json_check_mk.txt · Last modified: 2021/10/09 15:14 by 127.0.0.1