DewGew / DZGA-Flask

Domoticz Google Assisting using Flask
GNU General Public License v3.0
8 stars 4 forks source link

pidfile for monit #63

Closed Xenomes closed 4 months ago

Xenomes commented 7 months ago

Hi, I want to request a feature to add a pidfile for Monit.

check process dzga-flask with pidfile /var/run/dzga-flask.pid
start program = "/usr/bin/sudo systemctl start dzga-flask.service" with timeout 60 seconds
stop program = "/usr/bin/sudo systemctl stop dzga-flask.service"
if failed host 192.168.1.2 port 8181 with timeout 30 seconds for 5 cycles then restart
if 5 restarts within 5 cycles then timeout

the path /home/pi/-flask/dzga.pid is also an option.

Xenomes commented 5 months ago

I use now the following solution.

check host dzga-flask with address 192.168.*.*
start program = "/usr/bin/sudo systemctl start dzga-flask.service" with timeout 60 seconds
stop program = "/usr/bin/sudo systemctl stop dzga-flask.service"
if failed port 8181 protocol https request "/login" for 2 cycles then restart

Use the correct IP / Port and protocol.