summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMicah Anderson <micah@riseup.net>2011-04-12 19:01:38 -0400
committerMicah Anderson <micah@riseup.net>2011-04-12 19:01:38 -0400
commit43cc87a174f53062fa04990faf046ece9ab76f66 (patch)
tree1fdb292979442c54d5f220143c956b53ecedda67
parentfb75fcec220f9e2943d2e7af292ff884fd237f6d (diff)
add imap and pop service definitions
-rw-r--r--manifests/service/imap.pp32
-rw-r--r--manifests/service/pop.pp32
2 files changed, 64 insertions, 0 deletions
diff --git a/manifests/service/imap.pp b/manifests/service/imap.pp
new file mode 100644
index 0000000..063231d
--- /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/pop.pp b/manifests/service/pop.pp
new file mode 100644
index 0000000..3b87afc
--- /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}",
+ }
+ }
+}