Ansible inventory from Check_Mk

From the monitor host itself, so you can just tie directly to the livestatus socket (no SSL, etc), assuming a Linux with nc (netcat):

echo -e 'GET hosts\nColumns: name\nOutputFormat: json\n' | nc -U /opt/omd/sites/monit
or/tmp/run/live

Optionally, you can pretty print that JSON by piping through python -mjson.tool

Edit: the name of my site is “monitor” in the above path to the “live” socket.

1 Like