aboutsummaryrefslogtreecommitdiff
path: root/manifests/nagios.pp
blob: 4971f65c0e222a41209c6c31e4692ce1e7377f41 (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
define sshd::nagios(
  $port = 'absent',
  $ensure = 'present',
  $check_hostname = 'absent'
) {
  $real_port = $port ? {
    'absent' => $name,
    default => $port,
  }
  case $check_hostname {
    'absent': {
      nagios::service{"ssh_port_${name}":
        ensure => $ensure,
        check_command => "check_ssh_port!$port"
      }
    }
    default: {
      nagios::service{"ssh_port_host_${name}":
        ensure => $ensure,
        check_command => "check_ssh_port_host!${port}!${check_hostname}"
      }
    }
  }
}