X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=modules%2Fprivate%2Fmonitoring%2Fdefault.nix;h=0783c2ff33be9ee5fcfe1201c6cc8fd0a2af307c;hb=5315b439af1f72c3282549508ae58d86d66e38ec;hp=f00fb7c33c38a09f57e0f1a415d10c86006dcbb0;hpb=acab8301f6a0a76d97b36d009a60d4172bf62981;p=perso%2FImmae%2FConfig%2FNix.git diff --git a/modules/private/monitoring/default.nix b/modules/private/monitoring/default.nix index f00fb7c..0783c2f 100644 --- a/modules/private/monitoring/default.nix +++ b/modules/private/monitoring/default.nix @@ -27,7 +27,7 @@ let interface = "eth0"; }; eldiron = { - processWarn = "250"; processAlert = "400"; + processWarn = "550"; processAlert = "650"; loadWarn = "1.0"; loadAlert = "1.2"; interface = "eth0"; }; @@ -174,9 +174,6 @@ in }; }; - services.duplyBackup.profiles.monitoring = { - rootDir = config.services.naemon.varDir; - }; security.sudo.extraRules = let pluginsSudo = lib.lists.remove null (lib.attrsets.mapAttrsToList (k: v: if (v ? sudo) @@ -199,18 +196,15 @@ in text = "MAILADDR ${config.myEnv.monitoring.email}"; }; - secrets.keys = [ - { - dest = "naemon/id_rsa"; + secrets.keys = { + "naemon/id_rsa" = { user = "naemon"; group = "naemon"; permissions = "0400"; text = config.myEnv.monitoring.ssh_secret_key; - } - ] ++ lib.optionals cfg.master ( - lib.mapAttrsToList (k: v: - { - dest = "${k}_access_key"; + }; + } // lib.optionalAttrs cfg.master ( + lib.mapAttrs' (k: v: lib.nameValuePair "${k}_access_key" { user = "naemon"; group = "naemon"; permissions = "0400"; @@ -238,7 +232,7 @@ in broker_module=${pkgs.status_engine.module}/lib/status-engine/naemon/statusengine-${pkgs.naemon.status_engine_version}.o use_service_perfdata=1 use_process_data=0 use_system_command_data=0 use_external_command_data=0 use_flapping_data=0 use_program_status_data=0 use_notification_data=0 use_contact_status_data=0 use_contact_notification_data=0 use_event_handler_data=0 use_object_data=0 ''; extraResource = let - resources = lib.mapAttrsToList (k: v: v.resources or {}) mypluginsConfig; + resources = [hostObjects.resources or {}] ++ (lib.mapAttrsToList (k: v: v.resources or {}) mypluginsConfig); joined = lib.zipAttrsWith (n: v: if builtins.length (lib.unique v) == 1 then builtins.head v else abort "Non-unique resources names") resources; joinedStr = builtins.concatStringsSep "\n" (lib.mapAttrsToList (k: v: "$" + "${k}$=${v}") joined); in ''