summaryrefslogtreecommitdiff
path: root/manifests/nrpe.pp
diff options
context:
space:
mode:
authorGabriel Filion <gabster@lelutin.ca>2016-01-31 18:19:57 -0500
committerGabriel Filion <gabster@lelutin.ca>2016-01-31 18:19:57 -0500
commita534036c8d036275aa802f86470d67e4ee46db96 (patch)
tree495c77f0fe994745a21b7ce14dc45a126637ae39 /manifests/nrpe.pp
parentd1321c39001ebd445b37fd551fbfd324b6ab6ae0 (diff)
parametrize nagios::nrpe
the current code for configuring NRPE is still relying on global variables. This is not working at all with puppet 3.x and forward, so in order to make this code functional, we need to parametrize values that are used.
Diffstat (limited to 'manifests/nrpe.pp')
-rw-r--r--manifests/nrpe.pp24
1 files changed, 16 insertions, 8 deletions
diff --git a/manifests/nrpe.pp b/manifests/nrpe.pp
index ad7dbbb..eb68189 100644
--- a/manifests/nrpe.pp
+++ b/manifests/nrpe.pp
@@ -1,22 +1,30 @@
# setup nrpe stuff
-class nagios::nrpe {
+class nagios::nrpe (
+ $cfg_dir = '',
+ $pid_file = '',
+ $plugin_dir = '',
+ $server_address = '',
+ $allowed_hosts = '',
+) {
case $::operatingsystem {
'FreeBSD': {
- if $nagios_nrpe_cfgdir == '' { $nagios_nrpe_cfgdir = '/usr/local/etc' }
- if $nagios_nrpe_pid_file == '' { $nagios_nrpe_pid_file = '/var/spool/nagios/nrpe2.pid' }
- if $nagios_plugin_dir == '' { $nagios_plugin_dir = '/usr/local/libexec/nagios' }
+ 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 $nagios_nrpe_pid_file == '' { $nagios_nrpe_pid_file = '/var/run/nagios/nrpe.pid' }
- if $nagios_plugin_dir == '' { $nagios_plugin_dir = '/usr/lib/nagios/plugins' }
+ 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 $nagios_nrpe_pid_file == '' { $nagios_nrpe_pid_file = '/var/run/nrpe.pid' }
- if $nagios_plugin_dir == '' { $nagios_plugin_dir = '/usr/lib/nagios/plugins' }
+ 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 }