aboutsummaryrefslogblamecommitdiff
path: root/modules/private/monitoring/objects_dilion.nix
blob: 16b3c646c454262486f408c6bb19799165695a3a (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11










                                                                                         





                                                                                   

  
                               






                                                                                     


                                                        

    
{ 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;
  };
  zfs_snapshot = name: {
    passiveInfo = defaultPassiveInfo // { servicegroups = "webstatus-resources"; };
    service_description = "ZFS snapshot ${name} happened not too long ago";
    use = "local-service";
    check_command = ["check_zfs_snapshot" name];
  };
in
{
  activatedPlugins = [ "zfs" ];
  service = [
    {
      passiveInfo = defaultPassiveInfo // { servicegroups = "webstatus-resources"; };
      service_description = "No ZFS pool is degraded";
      use = "local-service";
      check_command = ["check_zfs"];
    }
    (zfs_snapshot "zpool/backup/eldiron/zpool/root")
    (zfs_snapshot "zpool/backup/eldiron/zpool/root/etc")
    (zfs_snapshot "zpool/backup/eldiron/zpool/root/var")
  ];
}