From dddff2316ee0ce0dab3540538de44a3829cc5c07 Mon Sep 17 00:00:00 2001 From: Gabriel Filion Date: Tue, 15 Feb 2011 19:11:50 -0500 Subject: nrpe.cfg: enable setting server_address By default, nrpe listens on every interfaces on the server. This is undesirable on Linux VServer hosts, since it will conflict with vservers. With a new variable, $nagios_nrpe_server_address, it is now possible to set the ip address on which the nrpe server will listen. --- templates/nrpe/nrpe.cfg | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'templates') diff --git a/templates/nrpe/nrpe.cfg b/templates/nrpe/nrpe.cfg index b31e5f9..b666e42 100644 --- a/templates/nrpe/nrpe.cfg +++ b/templates/nrpe/nrpe.cfg @@ -34,8 +34,11 @@ 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 -#server_address=192.168.1.1 - +<%- 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 %> +<%- end %> # NRPE USER -- cgit v1.2.3 From 8f24f259caa75f78ed501377c95c0a6fab0ebb11 Mon Sep 17 00:00:00 2001 From: Gabriel Filion Date: Mon, 7 Nov 2011 12:07:28 -0500 Subject: Fix NRPE for FreeBSD Plugins are found under another directory. The pid file must be changed to /var/spool/nagios/nrpe2.pid, since this place is writable by the daemon, and the rc script expects the pid file to be found there. Use a pattern instead of the rc script status command. --- templates/nrpe/nrpe.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'templates') diff --git a/templates/nrpe/nrpe.cfg b/templates/nrpe/nrpe.cfg index b666e42..5368bc8 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=/var/run/nrpe.pid +pid_file=<%= nagios_nrpe_pid_file %> -- cgit v1.2.3 From 0fe7552f256f0b1508cc5d3cab952eb93bee6811 Mon Sep 17 00:00:00 2001 From: mh Date: Tue, 5 Jun 2012 19:34:51 -0300 Subject: new style for 2.7 --- templates/irc_bot/CentOS/nagios-nsa.sh.erb | 4 ++-- templates/irc_bot/Debian/nagios-nsa.sh.erb | 4 ++-- templates/irc_bot/nsa.cfg.erb | 16 ++++++++-------- 3 files changed, 12 insertions(+), 12 deletions(-) (limited to 'templates') diff --git a/templates/irc_bot/CentOS/nagios-nsa.sh.erb b/templates/irc_bot/CentOS/nagios-nsa.sh.erb index 1561afd..0f9f87b 100644 --- a/templates/irc_bot/CentOS/nagios-nsa.sh.erb +++ b/templates/irc_bot/CentOS/nagios-nsa.sh.erb @@ -19,8 +19,8 @@ exec="/usr/local/bin/riseup-nagios-server.pl" prog="nsa" -PIDFILE=<%= nagios_nsa_pidfile %> -SOCKFILE=<%= nagios_nsa_socket %> +PIDFILE=<%= scope.lookupvar('nagios::irc_bot::real_nsa_pidfile') %> +SOCKFILE=<%= scope.lookupvar('nagios::irc_bot::real_nsa_socket') %> [ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog diff --git a/templates/irc_bot/Debian/nagios-nsa.sh.erb b/templates/irc_bot/Debian/nagios-nsa.sh.erb index 6e608db..16fa2ea 100644 --- a/templates/irc_bot/Debian/nagios-nsa.sh.erb +++ b/templates/irc_bot/Debian/nagios-nsa.sh.erb @@ -9,8 +9,8 @@ # Short-Description: Nagios Simple IRC Agent ### END INIT INFO -PIDFILE=<%= nagios_nsa_pidfile %> -SOCKFILE=<%= nagios_nsa_socket %> +PIDFILE=<%= scope.lookupvar('nagios::irc_bot::real_nsa_pidfile') %> +SOCKFILE=<%= scope.lookupvar('nagios::irc_bot::real_nsa_socket') %> . /lib/lsb/init-functions diff --git a/templates/irc_bot/nsa.cfg.erb b/templates/irc_bot/nsa.cfg.erb index 7cba62c..7285386 100644 --- a/templates/irc_bot/nsa.cfg.erb +++ b/templates/irc_bot/nsa.cfg.erb @@ -1,13 +1,13 @@ %Nsa = ( - 'socket' => '<%= nagios_nsa_socket %>', - 'server' => '<%= nagios_nsa_server %>', - 'port' => '<%= nagios_nsa_port %>', - 'nickname' => '<%= nagios_nsa_nickname %>', - 'password' => '<%= nagios_nsa_password %>', + 'socket' => '<%= scope.lookupvar('nagios::irc_bot::real_nsa_socket') %>', + 'server' => '<%= scope.lookupvar('nagios::irc_bot::nsa_server') %>', + 'port' => '<%= scope.lookupvar('nagios::irc_bot::nsa_port') %>', + 'nickname' => '<%= scope.lookupvar('nagios::irc_bot::nsa_nickname') %>', + 'password' => '<%= scope.lookupvar('nagios::irc_bot::nsa_password') %>', # this needs libio-socket-ssl-perl # doesn't actually works because Net::IRC is braindead and tries to use IO::Socket::SSL->read/write instead of the builtin print, see http://search.cpan.org/dist/IO-Socket-SSL/SSL.pm #'SSL' => 0, - 'channel' => '<%= nagios_nsa_channel %>', - 'pidfile' => '<%= nagios_nsa_pidfile %>', # set to undef to disable - 'realname' => "<%= nagios_nsa_realname %>", + 'channel' => '<%= scope.lookupvar('nagios::irc_bot::nsa_channel') %>', + 'pidfile' => '<%= scope.lookupvar('nagios::irc_bot::real_nsa_pidfile') %>', # set to undef to disable + 'realname' => "<%= scope.lookupvar('nagios::irc_bot::nsa_realname') %>", ); -- cgit v1.2.3 From 315a1942cacc58aecfe275599e54fa9da8252518 Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 6 Jun 2012 10:12:32 -0300 Subject: fix template --- templates/irc_bot/nsa.cfg.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'templates') diff --git a/templates/irc_bot/nsa.cfg.erb b/templates/irc_bot/nsa.cfg.erb index 7285386..cc7d274 100644 --- a/templates/irc_bot/nsa.cfg.erb +++ b/templates/irc_bot/nsa.cfg.erb @@ -1,4 +1,4 @@ -%Nsa = ( +%%Nsa = ( 'socket' => '<%= scope.lookupvar('nagios::irc_bot::real_nsa_socket') %>', 'server' => '<%= scope.lookupvar('nagios::irc_bot::nsa_server') %>', 'port' => '<%= scope.lookupvar('nagios::irc_bot::nsa_port') %>', -- cgit v1.2.3