-{ config, pkgs, hostFQDN, emailCheck, ... }:
+{ config, pkgs, nodes, hostFQDN, emailCheck, lib, ... }:
+let
+ to_resource = func: cfg: lib.flatten (lib.optionals cfg.enable (lib.mapAttrsToList func cfg.profiles));
+ to_backup_age_dependency = name: profile: map (remote:
+ {
+ dependent_host_name = "eldiron.immae.eu";
+ host_name = "eldiron.immae.eu";
+ dependent_service_description = "${remote} backup for ${name} is not too old";
+ service_description = "${remote} backup is up and not full";
+ execution_failure_criteria = "u";
+ notification_failure_criteria = "u";
+ }) profile.remotes;
+ to_backup_age = name: profile: map (remote:
+ {
+ service_description = "${remote} backup for ${name} is not too old";
+ host_name = "eldiron.immae.eu";
+ use = "external-service";
+ check_command = ["check_backup_${remote}_age" name];
+
+ check_interval = "120";
+ notification_interval = "1440";
+ }) profile.remotes;
+in