summaryrefslogtreecommitdiff
path: root/puppet/modules/nagios/manifests/nrpe.pp
blob: b7984b6e82d75edfb661ce38277870b791cc7d0c (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
33
34
35
36
37
38
39
40
41
# setup nrpe stuff
class nagios::nrpe (
  $cfg_dir = '',
  $pid_file = '',
  $plugin_dir = '',
  $server_address = '',
  $allowed_hosts = '',
  $dont_blame = '0',
) {

  if !($dont_blame in ['0', '1']) {
    fail('Unrecognized value for $dont_blame, must be one of "0", or "1".')
  }

  case $::operatingsystem {
    'FreeBSD': {
      if $cfg_dir == '' { $real_cfg_dir = '/usr/local/etc' }
      if $pid_file == '' { $real_pid_file = '/var/spool/nagios/nrpe2.pid' }
      if $plugin_dir == '' { $real_plugin_dir = '/usr/local/libexec/nagios' }

      include ::nagios::nrpe::freebsd
    }
    'Debian': {
      if $cfg_dir == '' { $real_cfg_dir = '/etc/nagios' }
      if $pid_file == '' { $real_pid_file = '/var/run/nagios/nrpe.pid' }
      if $plugin_dir == '' { $real_plugin_dir = '/usr/lib/nagios/plugins' }
      include ::nagios::nrpe::linux
    }
    default: {
      if $cfg_dir == '' { $real_cfg_dir = '/etc/nagios' }
      if $pid_file == '' { $real_pid_file = '/var/run/nrpe.pid' }
      if $plugin_dir == '' { $real_plugin_dir = '/usr/lib/nagios/plugins' }

      case $::kernel {
        'Linux': { include ::nagios::nrpe::linux }
        default: { include ::nagios::nrpe::base }
      }
    }
  }

}