From b8a0a4abbdfe5e10fb1c33c616508c540af5f13c Mon Sep 17 00:00:00 2001 From: Jonny007-MKD Date: Sun, 6 Mar 2022 22:19:43 +0100 Subject: [PATCH] Add command and service config --- command_check_gpg_key_expiration.conf | 12 ++++++++++++ service_check_gpg_key_expiration.conf | 19 +++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 command_check_gpg_key_expiration.conf create mode 100644 service_check_gpg_key_expiration.conf diff --git a/command_check_gpg_key_expiration.conf b/command_check_gpg_key_expiration.conf new file mode 100644 index 0000000..ff78e5d --- /dev/null +++ b/command_check_gpg_key_expiration.conf @@ -0,0 +1,12 @@ +object CheckCommand "gpg-key-expiration" { + import "plugin-check-command" + + command = [ "/home/nagios/check_gpg_key_expiration.sh/check_gpg_key_expiration.sh" ] + + arguments = { + "--warning" = "$check_gpg_key_expiration_warn$" + "--critical" = "$check_gpg_key_expiration_crit$" + "--url" = "$check_gpg_key_expiration_url$" + } +} + diff --git a/service_check_gpg_key_expiration.conf b/service_check_gpg_key_expiration.conf new file mode 100644 index 0000000..aab6b6e --- /dev/null +++ b/service_check_gpg_key_expiration.conf @@ -0,0 +1,19 @@ +apply Service "gpg-key " for (key => config in host.vars["gpg-key-expiration"]) { + import "generic-service" + + check_command = "gpg-key-expiration" + check_interval = 1d + retry_interval = 4h + vars.notification_interval = 1d + + vars.check_gpg_key_expiration_url = key + + for (k => v in config) { + if (match("_*", k)) { + vars[k.substr(1)] = v + } else { + vars["check_gpg_key_expiration_" + k] = v + } + } +} +