###############################################################################
## Monit control file
###############################################################################
SET DAEMON 300 # check services at 2-minute intervals
WITH START DELAY 240 # optional: delay the first check by 4-minutes (by default Monit check immediately after Monit start)
SET LOGFILE /var/ramdrive/monit.log
SET IDFILE /var/lib/monit/id
SET STATEFILE /var/lib/monit/state
SET EVENTQUEUE
BASEDIR /var/lib/monit/events
SLOTS 100
SET MAILSERVER
<mailserver address> port 465
USERNAME "<username>" PASSWORD "<password>"
SET HTTPD PORT 2812
ALLOW localhost
ALLOW 10.0.0.0/24 # allow local network
ALLOW admin:monit # require user 'admin' with password 'monit'
ALLOW @monit # allow users of group 'monit' to connect read/write
allow @users readonly # allow users of group 'users' to connect readonly
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
HOST 127.0.0.1 PORT 8080 PROTOCOL HTTP
AND REQUEST "/json.htm?type=command¶m=getversion"
AND CONTENT = '"status" : "OK"'
FOR 3 cycles
THEN RESTART
IF 5 RESTARTS WITHIN 5 CYCLES THEN EXEC "/sbin/reboot"
Next step is to figure out why monit reboots my Raspberry Pi every exact 3 hours :S
Then I get the following message:
There is no service named "domoticz"
Someone knows why ?
I tried the different configs posted in this thread and checked the ip's and all.
And yes, domoticz is running.
EDIT:
I have got it working now.
I think I forgot to realod the monit service. Got it all working after stopping the service and starting it again. No more error messages when I use the reload command or start command.
And I can see the status in both putty and webservice.
hello all,
one way or another but Domoticz main crashes after prox 10 hours since i have been struggling with master/slave RPI.
I cannot find the reason so installed Monit for help.
But the webpage shows domoticz not connected. I have checked the setting in security trusted network and 127.0.0.1 is present.
any idea