From e820134d38c3b7470ea5112f40a6dc967f039878 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Sun, 5 Jan 2020 17:08:32 +0100 Subject: Add monitoring host --- modules/private/monitoring/objects_eldiron.nix | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'modules/private/monitoring/objects_eldiron.nix') diff --git a/modules/private/monitoring/objects_eldiron.nix b/modules/private/monitoring/objects_eldiron.nix index 897fc15..bee4645 100644 --- a/modules/private/monitoring/objects_eldiron.nix +++ b/modules/private/monitoring/objects_eldiron.nix @@ -1,12 +1,25 @@ -{ ... }: +{ lib, hostFQDN, ... }: +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; + }; +in { service = [ { + passiveInfo = defaultPassiveInfo // { servicegroups = "webstatus-databases"; }; service_description = "Postgresql replication for backup-2 is up to date"; use = "local-service"; check_command = ["check_postgresql_replication" "backup-2" "/run/postgresql" "5432"]; } { + passiveInfo = defaultPassiveInfo // { servicegroups = "webstatus-email"; }; service_description = "mailq is empty"; use = "local-service"; check_command = ["check_mailq"]; -- cgit v1.2.3