summaryrefslogtreecommitdiff
path: root/puppet/modules/nagios/manifests/service/pop.pp
blob: 9ec4aec1d5871e3f4236ec6f746a038f081e7f9d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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}",
    }
  }
}