Monit ne relance pas domoticz

Forum dédié aux questions concernant la configuration de votre serveur sous Linux
lavinch31
Messages : 52
Inscription : 03 févr. 2020, 11:16

Monit ne relance pas domoticz

Message 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
Pi3b+ SSD
Zigbee Conbee II + Philips hue +Variateurs +smart buttons
Station meteo Netatmo
Plusieurs ESP8266 sous ESPEASY + DS18B20 + BMP280 +Relais
lavinch31
Messages : 52
Inscription : 03 févr. 2020, 11:16

Re: Monit ne relance pas domoticz

Message 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"
Pi3b+ SSD
Zigbee Conbee II + Philips hue +Variateurs +smart buttons
Station meteo Netatmo
Plusieurs ESP8266 sous ESPEASY + DS18B20 + BMP280 +Relais
Chrominator
Messages : 1042
Inscription : 19 déc. 2015, 07:29
Localisation : France

Re: Monit ne relance pas domoticz

Message 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.
Un bon frein vaut mieux que deux sparadraps.

Ubuntu 24.04.3 LTS - Domoticz 2025.1 (build 16782)
Pentium G3220T 2.6GHz - 4Go DDR3
RFXtrx433 USB Ver Pro1/1043
Z-Stick GEN5 Version: 1.6-1136-g07ea22bb
Rtl433 RTL-SDR receiver
RFLink Gateway
Zigbee SLZB-06
lavinch31
Messages : 52
Inscription : 03 févr. 2020, 11:16

Re: Monit ne relance pas domoticz

Message par lavinch31 »

Ça fonctionne !

Je cherchais plus compliqué 😔

Merci a toi 👍
Pi3b+ SSD
Zigbee Conbee II + Philips hue +Variateurs +smart buttons
Station meteo Netatmo
Plusieurs ESP8266 sous ESPEASY + DS18B20 + BMP280 +Relais
Répondre