monit: restart onlyoffice if failed

this should hopefully help with our consistent onlyoffice-does-not-work-but-no-one-noticed
problems (yes, monit runs as root and can do that).

"then restart" will still send an alert if it restarted the unit (see monit's man page)
This commit is contained in:
stuebinm 2024-03-05 17:51:10 +01:00
parent 1cee814e04
commit e81472cb87

View file

@ -22,11 +22,10 @@
alertAddress = "admin@hacc.space"; alertAddress = "admin@hacc.space";
config = (lib.replaceStrings ["port 22"] ["port ${toString (lib.head config.services.openssh.ports)}"] options.mailserver.monitoring.config.default) + '' config = (lib.replaceStrings ["port 22"] ["port ${toString (lib.head config.services.openssh.ports)}"] options.mailserver.monitoring.config.default) + ''
check host onlyoffice with address onlyoffice.infra4future.de check host onlyoffice with address onlyoffice.infra4future.de
if failed start program "/run/current-system/sw/bin/lxc-start onlyoffice"
port 443 stop program "/run/current-system/sw/bin/lxc-stop onlyoffice"
protocol https if failed port 443 protocol https status = 302
status = 302 then restart
then alert
''; '';
}; };
domains = [ domains = [