]> git.immae.eu Git - perso/Immae/Config/Nix.git/blob - private/monitoring/objects_eldiron.nix
Add tools
[perso/Immae/Config/Nix.git] / private / monitoring / objects_eldiron.nix
1 { lib, hostFQDN, emailCheck, ... }:
2 let
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 };
12 in
13 {
14 service = [
15 {
16 passiveInfo = defaultPassiveInfo // { servicegroups = "webstatus-databases"; };
17 service_description = "Postgresql replication for backup-2 is up to date";
18 use = "local-service";
19 check_command = ["check_postgresql_replication" "backup-2" "/run/postgresql" "5432"];
20 }
21 {
22 passiveInfo = defaultPassiveInfo // { servicegroups = "webstatus-email"; };
23 service_description = "mailq is empty";
24 use = "local-service";
25 check_command = ["check_mailq"];
26 }
27 (emailCheck "eldiron" hostFQDN // {
28 passiveInfo = defaultPassiveInfo // { servicegroups = "webstatus-email"; freshness_threshold = "1350"; };
29 })
30 ];
31 }