From e81472cb871377dc039d607cc0e9d8aca7ed072f Mon Sep 17 00:00:00 2001 From: stuebinm Date: Tue, 5 Mar 2024 17:51:10 +0100 Subject: [PATCH] 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) --- parsons/mail.nix | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/parsons/mail.nix b/parsons/mail.nix index 7d25d7b..213d98e 100644 --- a/parsons/mail.nix +++ b/parsons/mail.nix @@ -22,11 +22,10 @@ alertAddress = "admin@hacc.space"; 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 - if failed - port 443 - protocol https - status = 302 - then alert + start program "/run/current-system/sw/bin/lxc-start onlyoffice" + stop program "/run/current-system/sw/bin/lxc-stop onlyoffice" + if failed port 443 protocol https status = 302 + then restart ''; }; domains = [