I use code below in monit config to restart domoticz when "things" go wrong.
The code runs fine only the check fails :
url http://127.0.0.1:8080/json.htm?type=com ... getversion
and content = '"status" : "OK"'
Does it always have to be 127.0.0.1:8080 or should it be an other ip-address (my domoticz ip for example) ?
Code: Select all
check process domoticz with pidfile /var/run/domoticz.pid
start program = "/etc/init.d/domoticz.sh start"
stop program = "/etc/init.d/domoticz.sh stop"
if failed
url http://127.0.0.1:8080/json.htm?type=command¶m=getversion
and content = '"status" : "OK"'
for 2 cycles
then restart
if 5 restarts within 5 cycles then exec "/sbin/reboot"
if cpu usage > 70% for 3 cycles then restart