Add command and service config

This commit is contained in:
Jonny007-MKD 2022-03-06 22:19:43 +01:00
parent 597e47bb82
commit b8a0a4abbd
2 changed files with 31 additions and 0 deletions

View File

@ -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$"
}
}

View File

@ -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
}
}
}