X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=modules%2Fprivate%2Fmonitoring%2Fobjects_monitoring-1.nix;h=94b676bd701cc09bb5517060446c5b8be2898204;hb=7ad4966f41db0669a77c7a6ee7f87f0d4e586b0c;hp=ec6fdce88d7e92d73ff896d484622090c17ecb3b;hpb=8b2f048bed8d081f18d9ba7bc1cce16c28670217;p=perso%2FImmae%2FConfig%2FNix.git diff --git a/modules/private/monitoring/objects_monitoring-1.nix b/modules/private/monitoring/objects_monitoring-1.nix index ec6fdce..94b676b 100644 --- a/modules/private/monitoring/objects_monitoring-1.nix +++ b/modules/private/monitoring/objects_monitoring-1.nix @@ -1,4 +1,26 @@ -{ 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 { host = { # Dummy host for testing @@ -87,18 +109,29 @@ check_command = "check_ovh_sms"; check_interval = "120"; - notification_interval = "120"; + notification_interval = "1440"; } # Backup services { - service_description = "Eriomem backup is up and not full"; + service_description = "eriomem backup is up and not full"; + host_name = "eldiron.immae.eu"; + use = "external-service"; + check_command = "check_backup_eriomem"; + + check_interval = "120"; + notification_interval = "1440"; + + servicegroups = "webstatus-backup"; + } + { + service_description = "ovh backup is up and not full"; host_name = "eldiron.immae.eu"; use = "external-service"; - check_command = "check_eriomem"; + check_command = "check_ok"; check_interval = "120"; - notification_interval = "120"; + notification_interval = "1440"; servicegroups = "webstatus-backup"; } @@ -654,14 +687,29 @@ _webstatus_name = "LDAP"; _webstatus_url = "ldap.immae.eu"; } - ]; + + # Tiboqorl + { + service_description = "Cyllene support page is running"; + host_name = "tiboqorl.fr"; + use = "external-web-service"; + contact_groups = "tiboqorl"; + check_command = [ "check_https" "sc.groupe-cyllene.com" "/" "Support Client Cyllene" ]; + } + ] ++ to_resource to_backup_age nodes.eldiron.config.services.duplyBackup; contact = { telio-tortay = config.myEnv.monitoring.contacts.telio-tortay // { use = "generic-contact"; contactgroups = "telio-tortay"; }; + thibault = config.myEnv.monitoring.contacts.thibault // { + use = "generic-contact"; + contactgroups = "tiboqorl"; + }; }; contactgroup = { telio-tortay = { alias = "Telio Tortay"; members = "immae"; }; + tiboqorl = { alias = "Tiboqorl"; members = "immae"; }; }; + servicedependency = to_resource to_backup_age_dependency nodes.eldiron.config.services.duplyBackup; }