Add command and service config
This commit is contained in:
parent
597e47bb82
commit
b8a0a4abbd
2 changed files with 31 additions and 0 deletions
12
command_check_gpg_key_expiration.conf
Normal file
12
command_check_gpg_key_expiration.conf
Normal 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$"
|
||||
}
|
||||
}
|
||||
|
19
service_check_gpg_key_expiration.conf
Normal file
19
service_check_gpg_key_expiration.conf
Normal 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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in a new issue