summaryrefslogtreecommitdiff
path: root/flora/services/monit.nix
blob: c8f7b3f9130f67b0e8da9374f2d40d1dea2c3809 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{ 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 and use address localhost
          allow localhost
          allow admin:obwjoawijerfoijsiwfj29jf2f2jd

      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 protocol https
            then alert
    '';
  };
}