check domoticz with monit and restart when check fails Topic is solved

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.
Theedoek
Posts: 9
Joined: Wednesday 08 August 2018 22:09
Target OS: -
Domoticz version:
Contact:

Re: check domoticz with monit and restart when check fails

Post by Theedoek » Saturday 11 August 2018 14:32

That worked thanks. Finally solved it by checking the access rights. My monit control file now looks like this:

Code: Select all

###############################################################################
## 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&param=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

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests