]>
Commit | Line | Data |
---|---|---|
1a64deeb IB |
1 | { config, pkgs, lib, name, monitoring, ... }: |
2 | let | |
3 | hostFQDN = config.hostEnv.fqdn; | |
4 | emailCheck = monitoring.lib.emailCheck config.myEnv.monitoring.email_check; | |
5 | in | |
6 | { | |
408ce936 | 7 | config.myServices.monitoring.activatedPlugins = [ "memory" "command" "bandwidth" "emails" "mdadm" "postfix" "postgresql" "zfs" "notify-secondary" "smartctl" ]; |
1a64deeb IB |
8 | config.myServices.monitoring.pluginsArgs.postgresql.package = config.myServices.databases.postgresql.package; |
9 | config.myServices.monitoring.objects = lib.mkMerge [ | |
10 | (monitoring.lib.objectsCommon { | |
11 | inherit hostFQDN; | |
12 | hostName = name; | |
13 | master = false; | |
14 | processWarn = "550"; processAlert = "650"; | |
15 | loadWarn = "1.0"; loadAlert = "1.2"; | |
16 | interface = builtins.head (builtins.attrNames config.networking.interfaces); | |
17 | }) | |
18 | ||
19 | { | |
20 | service = [ | |
408ce936 IB |
21 | { |
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"; | |
26 | ||
27 | check_interval = 60; | |
28 | } | |
29 | { | |
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"; | |
34 | ||
35 | check_interval = 60; | |
36 | } | |
37 | { | |
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"; | |
42 | ||
43 | check_interval = 60; | |
44 | } | |
45 | { | |
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"; | |
50 | ||
51 | check_interval = 60; | |
52 | } | |
1a64deeb IB |
53 | { |
54 | service_description = "No mdadm array is degraded"; | |
55 | use = "local-service"; | |
56 | check_command = ["check_mdadm"]; | |
57 | __passive_servicegroups = "webstatus-resources"; | |
58 | } | |
59 | { | |
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"; | |
64 | } | |
65 | { | |
66 | service_description = "No ZFS pool is degraded"; | |
67 | use = "local-service"; | |
68 | check_command = ["check_zfs"]; | |
69 | __passive_servicegroups = "webstatus-resources"; | |
70 | } | |
71 | { | |
72 | service_description = "mailq is empty"; | |
73 | use = "local-service"; | |
74 | check_command = ["check_mailq"]; | |
75 | __passive_servicegroups = "webstatus-email"; | |
76 | } | |
77 | (emailCheck "eldiron" hostFQDN // { | |
78 | __passive_servicegroups = "webstatus-email"; | |
79 | }) | |
80 | ]; | |
81 | } | |
82 | ]; | |
83 | } |