]>
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 | { | |
7 | config.myServices.monitoring.activatedPlugins = [ "memory" "command" "bandwidth" "emails" "mdadm" "postfix" "postgresql" "zfs" "notify-secondary"]; | |
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 = [ | |
21 | { | |
22 | service_description = "No mdadm array is degraded"; | |
23 | use = "local-service"; | |
24 | check_command = ["check_mdadm"]; | |
25 | __passive_servicegroups = "webstatus-resources"; | |
26 | } | |
27 | { | |
28 | service_description = "Postgresql replication for backup-2 is up to date"; | |
29 | use = "local-service"; | |
30 | check_command = ["check_postgresql_replication" "backup-2" "/run/postgresql" "5432"]; | |
31 | __passive_servicegroups = "webstatus-databases"; | |
32 | } | |
33 | { | |
34 | service_description = "No ZFS pool is degraded"; | |
35 | use = "local-service"; | |
36 | check_command = ["check_zfs"]; | |
37 | __passive_servicegroups = "webstatus-resources"; | |
38 | } | |
39 | { | |
40 | service_description = "mailq is empty"; | |
41 | use = "local-service"; | |
42 | check_command = ["check_mailq"]; | |
43 | __passive_servicegroups = "webstatus-email"; | |
44 | } | |
45 | (emailCheck "eldiron" hostFQDN // { | |
46 | __passive_servicegroups = "webstatus-email"; | |
47 | }) | |
48 | ]; | |
49 | } | |
50 | ]; | |
51 | } |