summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2008-11-09 11:42:43 +0000
committermh <mh@immerda.ch>2008-11-09 11:42:43 +0000
commite8a51beb825c93d327a6d035c84cd3d7fdcd3bcd (patch)
tree2f0a3b57afeb2fb980e5a992ec4e7de997557ef6 /manifests
parent4ded8c8204b337a827f0ab3b50677e3d99d3465f (diff)
make domain to check choosable
Diffstat (limited to 'manifests')
-rw-r--r--manifests/defines.pp11
1 files changed, 8 insertions, 3 deletions
diff --git a/manifests/defines.pp b/manifests/defines.pp
index 010fbf5..c7c4abd 100644
--- a/manifests/defines.pp
+++ b/manifests/defines.pp
@@ -126,19 +126,24 @@ define nagios::service::ping(){
# - force: http is permanent redirect to https
# - only: check only https
define nagios::service::http(
+ $check_domain = 'absent',
$check_url = '/',
$check_code = 'OK',
$ssl_mode = 'false'
){
+ $real_check_domain = $check_domain ? {
+ 'absent' => $name,
+ default => $check_domain
+ }
case $ssl_mode {
'force','true','only': {
nagios::service{"https_${name}_${check_code}_${fqdn}":
- check_command => "check_https_url_regex!${name}!${check_url}!'${check_code}'",
+ check_command => "check_https_url_regex!${real_check_domain}!${check_url}!'${check_code}'",
}
case $ssl_mode {
'force': {
nagios::service{"httprd_${name}_${fqdn}":
- check_command => "check_http_url_regex!${name}!${check_url}!'301'",
+ check_command => "check_http_url_regex!${real_check_domain}!${check_url}!'301'",
}
}
}
@@ -147,7 +152,7 @@ define nagios::service::http(
case $ssl_mode {
'false','true': {
nagios::service{"http_${name}_${check_code}_${fqdn}":
- check_command => "check_http_url_regex!${name}!${check_url}!'${check_code}'",
+ check_command => "check_http_url_regex!${real_check_domain}!${check_url}!'${check_code}'",
}
}
}