summaryrefslogtreecommitdiff
path: root/manifests/service
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2013-01-02 17:51:29 +0100
committermh <mh@immerda.ch>2013-01-02 17:51:29 +0100
commit2b2268702938453bcece9ebe6070c03929910f8a (patch)
treef7ddfdfaf2430b19dcb7f89b3c16ccf4321976de /manifests/service
parentdf358dcf15d26ba59b59f686ceee4b07b3aed7dd (diff)
parenta2a80093d42b7e9eec9d2af3c66138f7ceaf9ed6 (diff)
Merge remote-tracking branch 'riseup/master' into HEAD
Conflicts: manifests/apache.pp manifests/base.pp manifests/defaults/templates.pp manifests/defaults/vars.pp manifests/init.pp manifests/irc_bot.pp manifests/nsca/client.pp manifests/nsca/server.pp manifests/service.pp manifests/service/mysql.pp templates/irc_bot/nsa.cfg.erb
Diffstat (limited to 'manifests/service')
-rw-r--r--manifests/service/imap.pp32
-rw-r--r--manifests/service/mysql.pp14
-rw-r--r--manifests/service/pop.pp32
3 files changed, 77 insertions, 1 deletions
diff --git a/manifests/service/imap.pp b/manifests/service/imap.pp
new file mode 100644
index 0000000..b703db4
--- /dev/null
+++ b/manifests/service/imap.pp
@@ -0,0 +1,32 @@
+define nagios::service::imap(
+ $ensure = 'present',
+ $host = 'absent',
+ $port = '143',
+ $tls = true,
+ $tls_port = '993'
+){
+
+ $real_host = $host ? {
+ 'absent' => $name,
+ default => $host
+ }
+
+ nagios::service{
+ "imap_${name}_${port}":
+ ensure => $ensure;
+ "imaps_${name}_${tls_port}":
+ ensure => $tls ? {
+ true => $ensure,
+ default => 'absent'
+ };
+ }
+
+ if $ensure != 'absent' {
+ Nagios::Service["imap_${name}_${port}"]{
+ check_command => "check_imap!${real_host}!${port}",
+ }
+ Nagios::Service["imaps_${name}_${tls_port}"]{
+ check_command => "check_imap_ssl!${real_host}!${tls_port}",
+ }
+ }
+}
diff --git a/manifests/service/mysql.pp b/manifests/service/mysql.pp
index 95f0970..4a9c81a 100644
--- a/manifests/service/mysql.pp
+++ b/manifests/service/mysql.pp
@@ -21,6 +21,18 @@ define nagios::service::mysql(
fail("Please specify a hostname, ip address or socket to check a mysql instance.")
}
+ if $check_name != undef {
+ $real_check_name = "!--name $check_name"
+ }
+
+ if $check_warning != undef {
+ $real_check_warning = "!--warning $check_warning"
+ }
+
+ if $check_critical != undef {
+ $real_check_critical = "!--critical $check_critical"
+ }
+
case $check_mode {
'tcp': {
if ($check_host == 'localhost') {
@@ -42,6 +54,6 @@ define nagios::service::mysql(
nagios::service { "mysql_health_${name}":
ensure => $ensure,
- check_command => "check_mysql_health!${check_host}!${check_port}!${check_username}!${check_password}!${name}!${check_database}",
+ 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/pop.pp b/manifests/service/pop.pp
new file mode 100644
index 0000000..9ec4aec
--- /dev/null
+++ b/manifests/service/pop.pp
@@ -0,0 +1,32 @@
+define nagios::service::pop(
+ $ensure = 'present',
+ $host = 'absent',
+ $port = '110',
+ $tls = true,
+ $tls_port = '995'
+){
+
+ $real_host = $host ? {
+ 'absent' => $name,
+ default => $host
+ }
+
+ nagios::service{
+ "pop_${name}_${port}":
+ ensure => $ensure;
+ "pops_${name}_${tls_port}":
+ ensure => $tls ? {
+ true => $ensure,
+ default => 'absent'
+ };
+ }
+
+ if $ensure != 'absent' {
+ Nagios::Service["pop_${name}_${port}"]{
+ check_command => "check_pop3!${real_host}!${port}",
+ }
+ Nagios::Service["pops_${name}_${tls_port}"]{
+ check_command => "check_pop3_ssl!${real_host}!${tls_port}",
+ }
+ }
+}