]> git.immae.eu Git - perso/Immae/Config/Nix.git/blame - modules/private/monitoring/objects_eldiron.nix
Refactor monitoring to avoid useless resources in each machine
[perso/Immae/Config/Nix.git] / modules / private / monitoring / objects_eldiron.nix
CommitLineData
71a2425e 1{ lib, hostFQDN, emailCheck, ... }:
e820134d
IB
2let
3 defaultPassiveInfo = {
4 filter = lib.attrsets.filterAttrs
5 (k: v: builtins.elem k ["service_description"] || builtins.substring 0 1 k == "_");
6 use = "external-passive-service";
7 freshness_threshold = "450";
8 retry_interval = "1";
9 servicegroups = "webstatus-resources";
10 host_name = hostFQDN;
11 };
12in
eb071dd4 13{
acab8301 14 activatedPlugins = [ "emails" "postgresql" "zfs" ];
eb071dd4
IB
15 service = [
16 {
e820134d 17 passiveInfo = defaultPassiveInfo // { servicegroups = "webstatus-databases"; };
eb071dd4
IB
18 service_description = "Postgresql replication for backup-2 is up to date";
19 use = "local-service";
20 check_command = ["check_postgresql_replication" "backup-2" "/run/postgresql" "5432"];
21 }
6ee77836
IB
22 {
23 passiveInfo = defaultPassiveInfo // { servicegroups = "webstatus-resources"; };
24 service_description = "No ZFS pool is degraded";
25 use = "local-service";
26 check_command = ["check_zfs"];
27 }
eb071dd4 28 {
e820134d 29 passiveInfo = defaultPassiveInfo // { servicegroups = "webstatus-email"; };
eb071dd4
IB
30 service_description = "mailq is empty";
31 use = "local-service";
32 check_command = ["check_mailq"];
33 }
71a2425e
IB
34 (emailCheck "eldiron" hostFQDN // {
35 passiveInfo = defaultPassiveInfo // { servicegroups = "webstatus-email"; freshness_threshold = "1350"; };
36 })
eb071dd4
IB
37 ];
38}