From 8c13f3e743fe3de7ff8e5aef421099cc37a117be Mon Sep 17 00:00:00 2001 From: stuebinm Date: Sun, 7 Apr 2024 20:02:27 +0200 Subject: common/headless: basic monitoring on by default --- flora/services/monit.nix | 32 -------------------------------- 1 file changed, 32 deletions(-) (limited to 'flora/services/monit.nix') diff --git a/flora/services/monit.nix b/flora/services/monit.nix index 6c11522..0b7ee7c 100644 --- a/flora/services/monit.nix +++ b/flora/services/monit.nix @@ -1,27 +1,9 @@ { config, lib, pkgs, ... }: { - # includes mail address, which includes ntfy token - sops.secrets."monit/mail" = {}; - services.monit = { - enable = true; config = '' - include /run/secrets/monit/mail - - set daemon 120 with start delay 60 - set mailserver - localhost - port 2525 - - set httpd port 2812 address localhost - allow localhost - - check filesystem root with path / - if space usage > 80% then alert - if inode usage > 80% then alert - check host stuebinm.eu with address stuebinm.eu if failed port 443 with protocol https then alert @@ -34,11 +16,6 @@ if failed port 64738 of type tcp using ssl with expect "NixOS" then alert - check process sshd with pidfile /var/run/sshd.pid - start program "${pkgs.systemd}/bin/systemctl start sshd" - stop program "${pkgs.systemd}/bin/systemctl stop sshd" - if failed port 22 protocol ssh for 2 cycles then restart - check process postfix with pidfile /var/lib/postfix/queue/pid/master.pid start program = "${pkgs.systemd}/bin/systemctl start postfix" stop program = "${pkgs.systemd}/bin/systemctl stop postfix" @@ -53,9 +30,6 @@ if failed port 443 with protocol https then alert - check program is-system-running path ${pkgs.systemd}/bin/systemctl is-system-running - if status != 0 then alert - check host hacc-uffd with address login.infra4future.de if failed port 443 with protocol https then alert @@ -67,12 +41,6 @@ check host hacc-mattermost with address mattermost.infra4future.de if failed port 443 with protocol https then alert - - set mail-format { - subject: $SERVICE: $EVENT - message: Action: $ACTION $SERVICE: $DESCRIPTION. - ($DATE) - } ''; }; -- cgit v1.2.3