summaryrefslogtreecommitdiff
path: root/manifests/nrpe/base.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/base.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/base.pp')
-rw-r--r--manifests/nrpe/base.pp15
1 files changed, 10 insertions, 5 deletions
diff --git a/manifests/nrpe/base.pp b/manifests/nrpe/base.pp
index fe1cd7c..fb62693 100644
--- a/manifests/nrpe/base.pp
+++ b/manifests/nrpe/base.pp
@@ -1,7 +1,12 @@
# basic nrpe stuff
class nagios::nrpe::base {
- if $nagios_nrpe_cfgdir == '' { $nagios_nrpe_cfgdir = '/etc/nagios' }
+ # Import all variables from entry point
+ $cfg_dir = $::nagios::nrpe::real_cfg_dir
+ $pid_file = $::nagios::nrpe::real_pid_file
+ $plugin_dir = $::nagios::nrpe::real_plugin_dir
+ $server_address = $::nagios::nrpe::server_address
+ $allowed_hosts = $::nagios::nrpe::allowed_hosts
package{['nagios-nrpe-server', 'nagios-plugins-basic', 'libwww-perl']:
ensure => installed;
@@ -13,12 +18,12 @@ class nagios::nrpe::base {
}
file{
- [ $nagios_nrpe_cfgdir, "${nagios_nrpe_cfgdir}/nrpe.d" ]:
+ [ $cfg_dir, "${cfg_dir}/nrpe.d" ]:
ensure => directory;
}
if $nagios_nrpe_dont_blame == '' { $nagios_nrpe_dont_blame = 1 }
- file { "${nagios_nrpe_cfgdir}/nrpe.cfg":
+ file { "${cfg_dir}/nrpe.cfg":
content => template('nagios/nrpe/nrpe.cfg'),
owner => root,
group => 0,
@@ -40,14 +45,14 @@ class nagios::nrpe::base {
$critical_5_threshold = 9 * $::processorcount
$critical_15_threshold = 8 * $::processorcount
nagios::nrpe::command {'check_load':
- command_line => "${nagios_plugin_dir}/check_load -w ${warning_1_threshold},${warning_5_threshold},${warning_15_threshold} -c ${critical_1_threshold},${critical_5_threshold},${critical_15_threshold}",
+ command_line => "${plugin_dir}/check_load -w ${warning_1_threshold},${warning_5_threshold},${warning_15_threshold} -c ${critical_1_threshold},${critical_5_threshold},${critical_15_threshold}",
}
service{'nagios-nrpe-server':
ensure => running,
enable => true,
pattern => 'nrpe',
- subscribe => File["${nagios_nrpe_cfgdir}/nrpe.cfg"],
+ subscribe => File["${cfg_dir}/nrpe.cfg"],
require => Package['nagios-nrpe-server'],
}
}