aboutsummaryrefslogblamecommitdiff
path: root/modules/private/monitoring/objects_eldiron.nix
blob: 92f997f06f0931aa07cf836e0d65ff9bb773d208 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
                                   










                                                                                         


             
                                                                                     




                                                                                           
                                                                                 



                                             


                                                                                                               

    
{ lib, hostFQDN, emailCheck, ... }:
let
  defaultPassiveInfo = {
    filter = lib.attrsets.filterAttrs
      (k: v: builtins.elem k ["service_description"] || builtins.substring 0 1 k == "_");
    use = "external-passive-service";
    freshness_threshold = "450";
    retry_interval = "1";
    servicegroups = "webstatus-resources";
    host_name = hostFQDN;
  };
in
{
  service = [
    {
      passiveInfo = defaultPassiveInfo // { servicegroups = "webstatus-databases"; };
      service_description = "Postgresql replication for backup-2 is up to date";
      use = "local-service";
      check_command = ["check_postgresql_replication" "backup-2" "/run/postgresql" "5432"];
    }
    {
      passiveInfo = defaultPassiveInfo // { servicegroups = "webstatus-email"; };
      service_description = "mailq is empty";
      use = "local-service";
      check_command = ["check_mailq"];
    }
    (emailCheck "eldiron" hostFQDN // {
      passiveInfo = defaultPassiveInfo // { servicegroups = "webstatus-email"; freshness_threshold = "1350"; };
    })
  ];
}