= Naemond query = Ref [https://docs.checkmk.com/latest/en/livestatus.html check_mk][[br]] Ref [https://www.naemon.io/documentation/usersguide/livestatus.html naemon][[br]] {{{ #!sh OMD[monitor@0e]:~$ lq "GET services\nColumns: host_name description state \nFilter: host_name = RUTest0001 \nFilter: acknowledged = 1 \nFilter: state != 0 " }}} {{{ #!sh OMD[monitor@cd203ce131df]:~$ lq "GET services\nColumns: host_name host_state description state \nFilter: host_name = localhost \nFilter: host_state = 2 \nFilter: state != 0" localhost;2;ssh;1 }}} {{{ #!sh OMD[monitor@cd]:~$ printf "GET hosts\nColumns: services_with_state notifications_enabled num_services \n" | unixcat ~/tmp/run/live }}} {{{ lq "GET services\nColumns: host_name host_state description state host_last_notification notifications_enabled\nFilter: host_name = localhost \nFilter: host_state != 0 \nFilter: state != 0" }}} {{{ printf "[%lu] SEND_CUSTOM_SVC_NOTIFICATION;localhost;ssh;0;omdadmin;SSH notify by KT.\n" > /opt/omd/sites/monitor/tmp/run/naemon.cmd }}} {{{ lq "GET services\nColumns: host_name host_state description state host_last_notification notifications_enabled last_hard_state_change last_hard_state last_state\nFilter: host_name = localhost " }}} run as root {{{ root@0e3f9eda2de0:~# printf "GET hosts\nColumns: services_with_state notifications_enabled num_services \n" | /omd/sites/monitor/bin/unixcat /omd/sites/monitor/tmp/run/live }}}