aboutsummaryrefslogtreecommitdiff
path: root/modules/private/monitoring/objects_monitoring-1.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/private/monitoring/objects_monitoring-1.nix')
-rw-r--r--modules/private/monitoring/objects_monitoring-1.nix25
1 files changed, 1 insertions, 24 deletions
diff --git a/modules/private/monitoring/objects_monitoring-1.nix b/modules/private/monitoring/objects_monitoring-1.nix
index 0e7d9df..563be16 100644
--- a/modules/private/monitoring/objects_monitoring-1.nix
+++ b/modules/private/monitoring/objects_monitoring-1.nix
@@ -1,26 +1,4 @@
1{ config, pkgs, nodes, hostFQDN, emailCheck, lib, ... }: 1{ config, pkgs, nodes, hostFQDN, emailCheck, lib, ... }:
2let
3 to_resource = func: cfg: lib.flatten (lib.optionals cfg.enable (lib.mapAttrsToList func cfg.profiles));
4 to_backup_age_dependency = name: profile: map (remote:
5 {
6 dependent_host_name = "eldiron.immae.eu";
7 host_name = "eldiron.immae.eu";
8 dependent_service_description = "${remote} backup for ${name} is not too old";
9 service_description = "${remote} backup is up and not full";
10 execution_failure_criteria = "u";
11 notification_failure_criteria = "u";
12 }) profile.remotes;
13 to_backup_age = name: profile: map (remote:
14 {
15 service_description = "${remote} backup for ${name} is not too old";
16 host_name = "eldiron.immae.eu";
17 use = "external-service";
18 check_command = ["check_backup_${remote}_age" name];
19
20 check_interval = "120";
21 notification_interval = "1440";
22 }) profile.remotes;
23in
24{ 2{
25 activatedPlugins = [ "dns" "ftp" "git" "http" "imap" "ovh" "tcp" ]; 3 activatedPlugins = [ "dns" "ftp" "git" "http" "imap" "ovh" "tcp" ];
26 host = { 4 host = {
@@ -718,7 +696,7 @@ in
718 check_command = [ "check_https" "origny.tiboqorl.fr" "/" "<title>Home Assistant" ]; 696 check_command = [ "check_https" "origny.tiboqorl.fr" "/" "<title>Home Assistant" ];
719 _webstatus_namespace = "tiboqorl"; 697 _webstatus_namespace = "tiboqorl";
720 } 698 }
721 ] ++ to_resource to_backup_age nodes.eldiron.config.services.duplyBackup; 699 ];
722 contact = { 700 contact = {
723 telio-tortay = config.myEnv.monitoring.contacts.telio-tortay // { 701 telio-tortay = config.myEnv.monitoring.contacts.telio-tortay // {
724 use = "generic-contact"; 702 use = "generic-contact";
@@ -733,5 +711,4 @@ in
733 telio-tortay = { alias = "Telio Tortay"; members = "immae"; }; 711 telio-tortay = { alias = "Telio Tortay"; members = "immae"; };
734 tiboqorl = { alias = "Tiboqorl"; members = "immae"; }; 712 tiboqorl = { alias = "Tiboqorl"; members = "immae"; };
735 }; 713 };
736 servicedependency = to_resource to_backup_age_dependency nodes.eldiron.config.services.duplyBackup;
737} 714}