1 { config, pkgs, lib, name, monitoring, ... }:
3 hostFQDN = config.hostEnv.fqdn;
4 emailCheck = monitoring.lib.emailCheck config.myEnv.monitoring.email_check;
7 config.myServices.monitoring.activatedPlugins = [ "memory" "command" "bandwidth" "emails" "mdadm" "postfix" "postgresql" "zfs" "notify-secondary" "smartctl" ];
8 config.myServices.monitoring.pluginsArgs.postgresql.package = config.myServices.databases.postgresql.package;
9 config.myServices.monitoring.objects = lib.mkMerge [
10 (monitoring.lib.objectsCommon {
14 processWarn = "550"; processAlert = "650";
15 loadWarn = "1.0"; loadAlert = "1.2";
16 interface = builtins.head (builtins.attrNames config.networking.interfaces);
22 service_description = "Disk /dev/disk/by-id/ata-ST33000650NS_Z29540DM is sane";
23 use = "local-service";
24 check_command = [ "check_smartctl" "/dev/disk/by-id/ata-ST33000650NS_Z29540DM" ];
25 __passive_servicegroups = "webstatus-resources";
30 service_description = "Disk /dev/disk/by-id/ata-ST33000650NS_Z296JGJ4 is sane";
31 use = "local-service";
32 check_command = [ "check_smartctl" "/dev/disk/by-id/ata-ST33000650NS_Z296JGJ4" ];
33 __passive_servicegroups = "webstatus-resources";
38 service_description = "Disk /dev/disk/by-id/ata-SAMSUNG_MZ7LM480HMHQ-00005_S2UJNX0HA05895 is sane";
39 use = "local-service";
40 check_command = [ "check_smartctl" "/dev/disk/by-id/ata-SAMSUNG_MZ7LM480HMHQ-00005_S2UJNX0HA05895" ];
41 __passive_servicegroups = "webstatus-resources";
46 service_description = "Disk /dev/disk/by-id/ata-Micron_5200_MTFDDAK480TDC_18011BEE03B3 is sane";
47 use = "local-service";
48 check_command = [ "check_smartctl" "/dev/disk/by-id/ata-Micron_5200_MTFDDAK480TDC_18011BEE03B3" ];
49 __passive_servicegroups = "webstatus-resources";
54 service_description = "No mdadm array is degraded";
55 use = "local-service";
56 check_command = ["check_mdadm"];
57 __passive_servicegroups = "webstatus-resources";
60 service_description = "Postgresql replication for backup-2 is up to date";
61 use = "local-service";
62 check_command = ["check_postgresql_replication" "backup-2" "/run/postgresql" "5432"];
63 __passive_servicegroups = "webstatus-databases";
66 service_description = "No ZFS pool is degraded";
67 use = "local-service";
68 check_command = ["check_zfs"];
69 __passive_servicegroups = "webstatus-resources";
72 service_description = "mailq is empty";
73 use = "local-service";
74 check_command = ["check_mailq"];
75 __passive_servicegroups = "webstatus-email";
77 (emailCheck "eldiron" hostFQDN // {
78 __passive_servicegroups = "webstatus-email";