summaryrefslogtreecommitdiff
path: root/manifests/service
diff options
context:
space:
mode:
authorLeap devs <sysdev@leap.se>2012-09-19 16:29:34 +0000
committerLeap devs <sysdev@leap.se>2012-09-19 16:29:34 +0000
commiteafb4c73ee82915bf83eac01bb26265c531a68e2 (patch)
treecc43c64a64eed30c601a1aaa04e0521beca43a75 /manifests/service
parent66257f3c425fea5fcea2acb999854aae5e7cf9f1 (diff)
parent41fe95b36253826b8f801ee1669acdb28c70076c (diff)
Merge branch 'immerda'
Conflicts: manifests/apache.pp manifests/irc_bot.pp manifests/service/mysql.pp templates/irc_bot/nsa.cfg.erb Conflict resolutions: apache.pp: just cosmetics mysql.pp: The shared modules provides more variables to fine tune the mysql health check so we went for this version. The irc bot conflicts were a result of immerda's branch not being up-to-date with the shared branch. The shared branch had factored out the irc_bot.pp into a directory, and added a few additional variables. Immerda changed the variables from having the prefix $nagios_ to not having it and did not have that refactor. The variable renames were good ones for the 2.7 refactoring work, and future hiera integration, so we want those. So to resolve this, we took the shared version of the refactor, and then took the immerda version of the variable renames. This requires an UPGRADE NOTICE in the README as people may have been using the previous variable names.
Diffstat (limited to 'manifests/service')
-rw-r--r--manifests/service/http.pp5
-rw-r--r--manifests/service/mysql.pp8
-rw-r--r--manifests/service/ntp.pp8
-rw-r--r--manifests/service/ping.pp16
4 files changed, 17 insertions, 20 deletions
diff --git a/manifests/service/http.pp b/manifests/service/http.pp
index 8fd5059..ef63abb 100644
--- a/manifests/service/http.pp
+++ b/manifests/service/http.pp
@@ -6,6 +6,7 @@
define nagios::service::http(
$ensure = present,
$check_domain = 'absent',
+ $port = '80',
$check_url = '/',
$check_code = 'OK',
$use = 'generic-service',
@@ -27,7 +28,7 @@ define nagios::service::http(
nagios::service{"httprd_${name}":
ensure => $ensure,
use => $use,
- check_command => "check_http_url_regex!${real_check_domain}!${check_url}!'301'",
+ check_command => "check_http_url_regex!${real_check_domain}!${port}!${check_url}!'301'",
}
}
}
@@ -38,7 +39,7 @@ define nagios::service::http(
nagios::service{"http_${name}_${check_code}":
ensure => $ensure,
use => $use,
- check_command => "check_http_url_regex!${real_check_domain}!${check_url}!'${check_code}'",
+ check_command => "check_http_url_regex!${real_check_domain}!${port}!${check_url}!'${check_code}'",
}
}
}
diff --git a/manifests/service/mysql.pp b/manifests/service/mysql.pp
index 2fde402..94881d8 100644
--- a/manifests/service/mysql.pp
+++ b/manifests/service/mysql.pp
@@ -1,11 +1,11 @@
-# Checks a mysql instance via tcp or socket
+# Checks a mysql instance via tcp or socket
define nagios::service::mysql(
$ensure = present,
$check_host = 'absent',
$check_port = '3306',
$check_username = 'nagios',
- $check_password = $nagios_mysql_password,
+ $check_password = trocla("mysql_nagios_${::fqdn}",'plain','length: 32'),
$check_database = 'information_schema',
$check_warning = undef,
$check_critical = undef,
@@ -28,7 +28,7 @@ define nagios::service::mysql(
if $check_warning != undef {
$real_check_warning = "!--warning $check_warning"
}
-
+
if $check_critical != undef {
$real_check_critical = "!--critical $check_critical"
}
@@ -51,7 +51,7 @@ define nagios::service::mysql(
}
}
}
-
+
nagios::service { "mysql_health_${name}":
ensure => $ensure,
check_command => "check_mysql_health!${real_check_host}!${check_port}!${check_username}!${check_password}!${check_health_mode}!${check_database}${real_check_name}${real_check_warning}${real_check_critical}",
diff --git a/manifests/service/ntp.pp b/manifests/service/ntp.pp
index eca255a..b3cde2a 100644
--- a/manifests/service/ntp.pp
+++ b/manifests/service/ntp.pp
@@ -1,9 +1,9 @@
# manifests/service/ntp.pp
class nagios::service::ntp {
- nagios::service{ "check_ntp":
- check_command => "check_ntp_time",
- host_name => $fqdn,
- }
+ nagios::service{ "check_ntp":
+ check_command => "check_ntp_time",
+ host_name => $::fqdn,
+ }
}
diff --git a/manifests/service/ping.pp b/manifests/service/ping.pp
index c705c68..f1c8d87 100644
--- a/manifests/service/ping.pp
+++ b/manifests/service/ping.pp
@@ -1,13 +1,9 @@
define nagios::service::ping(
- $ensure = present
+ $ensure = present,
+ $ping_rate = '!100.0,20%!500.0,60%'
){
- $real_nagios_ping_rate = $nagios_ping_rate ? {
- '' => '!100.0,20%!500.0,60%',
- default => $nagios_ping_rate
- }
-
- nagios::service{ "check_ping":
- ensure => $ensure,
- check_command => "check_ping${real_nagios_ping_rate}",
- }
+ nagios::service{ "check_ping":
+ ensure => $ensure,
+ check_command => "check_ping${ping_rate}",
+ }
}