diff options
author | LeLutin <gabster@lelutin.ca> | 2016-02-25 06:59:19 +0000 |
---|---|---|
committer | LeLutin <gabster@lelutin.ca> | 2016-02-25 06:59:19 +0000 |
commit | c0dee4a2393e23b226e123a427898de94b342141 (patch) | |
tree | 449a726cec957808bdc52fd8e46a6acdaead777c /templates/nrpe/nrpe.cfg | |
parent | 5163d89155eec6b6b39994d0cd18e6ceeff8b180 (diff) | |
parent | 2892e1795a823c2bee2893bc339854dd4f5e5b94 (diff) |
Merge branch 'nrpe_params' into 'master'
Nrpe params
The nagios::nrpe class is currently completely unusable with puppet 3.x+
This is because it's still relying on global variables. When one tries to setup an nrpe client with nagios::nrpe with puppet 3.x, the following error occurs:
~~~
==> jessiepuppet: Error: Failed to parse template nagios/nrpe/nrpe.cfg:
==> jessiepuppet: Filepath: /usr/lib/ruby/vendor_ruby/puppet/parser/templatewrapper.rb
==> jessiepuppet: Line: 81
==> jessiepuppet: Detail: Could not find value for 'nagios_nrpe_pid_file' at /etc/puppet/modules/nagios/templates/nrpe/nrpe.cfg:19
==> jessiepuppet: at /etc/puppet/modules/nagios/manifests/nrpe/base.pp:22 on node jessie.vagrantup.com
==> jessiepuppet: Error: Failed to parse template nagios/nrpe/nrpe.cfg:
==> jessiepuppet: Filepath: /usr/lib/ruby/vendor_ruby/puppet/parser/templatewrapper.rb
==> jessiepuppet: Line: 81
==> jessiepuppet: Detail: Could not find value for 'nagios_nrpe_pid_file' at /etc/puppet/modules/nagios/templates/nrpe/nrpe.cfg:19
==> jessiepuppet: at /etc/puppet/modules/nagios/manifests/nrpe/base.pp:22 on node jessie.vagrantup.com
~~~
This is because the values of variables defined within nagios::nrpe are not propagated into other classes anymore.
This series also changes a default behaviour for creating saner configurations by default: the dont_blame_nrpe option is changed to disable command arguments by default.
It also adds some documentation for the nagios::nrpe class since it had no explanation whatsoever of how it should be used in the README.
See merge request !18
Diffstat (limited to 'templates/nrpe/nrpe.cfg')
-rw-r--r-- | templates/nrpe/nrpe.cfg | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/templates/nrpe/nrpe.cfg b/templates/nrpe/nrpe.cfg index 2ae2d71..d4ad9a4 100644 --- a/templates/nrpe/nrpe.cfg +++ b/templates/nrpe/nrpe.cfg @@ -16,7 +16,7 @@ # number. The file is only written if the NRPE daemon is started by the root # user and is running in standalone mode. -pid_file=<%= nagios_nrpe_pid_file %> +pid_file=<%= @pid_file %> @@ -34,10 +34,8 @@ server_port=5666 # and you do not want nrpe to bind on all interfaces. # NOTE: This option is ignored if NRPE is running under either inetd or xinetd -<%- if has_variable?("nagios_nrpe_server_address") then %> -<%- if not nagios_nrpe_server_address.to_s.empty? then %> -server_address=<%= nagios_nrpe_server_address %> -<%- end %> +<%- if not @server_address.to_s.empty? then %> +server_address=<%= @server_address %> <%- end %> @@ -72,10 +70,10 @@ nrpe_group=nagios # # NOTE: This option is ignored if NRPE is running under either inetd or xinetd -<%- if nagios_nrpe_allowed_hosts.to_s.empty? then %> +<%- if @allowed_hosts.to_s.empty? then %> allowed_hosts=127.0.0.1 <%- else %> -allowed_hosts=127.0.0.1,<%= nagios_nrpe_allowed_hosts %> +allowed_hosts=127.0.0.1,<%= @allowed_hosts %> <%- end %> # COMMAND ARGUMENT PROCESSING @@ -90,7 +88,7 @@ allowed_hosts=127.0.0.1,<%= nagios_nrpe_allowed_hosts %> # # Values: 0=do not allow arguments, 1=allow command arguments -dont_blame_nrpe=1 +dont_blame_nrpe=<%= @dont_blame %> # COMMAND PREFIX @@ -157,7 +155,7 @@ command_timeout=60 #include_dir=<somedirectory> #include_dir=<someotherdirectory> -include_dir=<%= nagios_nrpe_cfgdir %>/nrpe.d +include_dir=<%= @cfg_dir %>/nrpe.d |