Page 1 sur 1

Monit ne relance pas domoticz

Publié : 13 avr. 2020, 17:15
par lavinch31
Bonjour,

je rencontre un problème récurrent avec Monit .

Après une coupure de courant , Domoticz ne se relance pas :

Monit log:

Code : Tout sélectionner

[CEST Apr 13 16:33:56] info     : Starting Monit 5.25.2 daemon with http interface at [*]:2812
[CEST Apr 13 16:33:56] info     : Monit start delay set to 300s
[CEST Apr 13 17:05:18] error    : Cannot create socket to [localhost]:2812 -- Connection refused
[CEST Apr 13 17:06:47] info     : 'raspberrypi' Monit 5.25.2 started
[CEST Apr 13 17:06:47] error    : 'domoticz' process is not running
[CEST Apr 13 17:06:47] info     : 'domoticz' trying to restart
[CEST Apr 13 17:06:47] info     : 'domoticz' start: '/etc/init.d/domoticz.sh start'
[CEST Apr 13 17:07:17] error    : 'domoticz' failed to start (exit status 0) -- '/etc/init.d/domoticz.sh start': Starting domoticz.sh (via systemctl): domoticz.service.
j'ai l'impression que Monit n'a pas les droits pour exécuter la commande

Code : Tout sélectionner

/etc/init.d/domoticz.sh start

je ne sais pas comment faire pour contourner ce problème , pouvez-vous m'aider ?

Merci pour votre aide

Re: Monit ne relance pas domoticz

Publié : 13 avr. 2020, 17:44
par lavinch31
voici le contenu du fichier monitrc:

Code : Tout sélectionner

###########################
## Monit control file
###########################

set daemon 300            # check services at 5-minute intervals
with start delay 300  # optional: delay the first check by 4-minutes


set log /ramdisk/monit.log
set idfile /var/lib/monit/id
set statefile /var/lib/monit/state

set eventqueue
      basedir /var/lib/monit/events # set the base directory where events will be stored
      slots 100                     # optionally limit the queue size


set httpd port 2812 and

allow localhost        # allow localhost to connect to the server and
allow 0.0.0.0/0.0.0.0
allow admin:monit      # require user 'admin' with password 'monit'
allow @monit
allow @users readonly



############
##Includes
############

include /etc/monit/conf.d/*
   include /etc/monit/conf-enabled/*

# surveillance domoticz
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://monipdomoticz:port/json.htm?type=command&param=getversion
                and content = '"status" : "OK"'
        for 2 cycles
        then restart
if 5 restarts within 5 cycles then exec "/sbin/reboot"

Re: Monit ne relance pas domoticz

Publié : 13 avr. 2020, 18:21
par Chrominator
Tu pourrais essayer

Code : Tout sélectionner

start program = "/etc/init.d/domoticz.sh restart"
pour voir;
C'est pas très logique mais faut essayer.

Re: Monit ne relance pas domoticz

Publié : 13 avr. 2020, 20:45
par lavinch31
Ça fonctionne !

Je cherchais plus compliqué 😔

Merci a toi 👍