[Nagios-devel] [PATCH] nrpe sysv init script: read extra
Posted: Fri May 30, 2008 1:48 pm
--=-1XPP4ycUebFQkXsOXqCe
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
[excuse any duplicates, original sent from non-subscribed account]
I'm using nrpe on a bunch of CentOS machines. nrpe is being started via
the standard sysv init script system, so it uses the 'init-script'
bundled in the nrpe tarball (actually, I using the nrpe build provided
by the EPEL guys, but that doesn't really matter).
The problem is that some of my plugins require an environment to be set,
but on CentOS the 'service nrpe start' explicitly starts the daemon with
a clean and empty environment.
The typical way to handle this is to allow for an /etc/sysconfig/blah
(in this case 'blah' is 'nrpe') script which customizes an explicit
environment for the daemon.
That's what the attached patch, against nrpe 2.7, does.
Could it be included in the next release?
Thanks,
David
--=-1XPP4ycUebFQkXsOXqCe
Content-Disposition: attachment; filename=nrpe-read-extra-conf.patch
Content-Type: text/x-patch; name=nrpe-read-extra-conf.patch; charset=UTF-8
Content-Transfer-Encoding: 7bit
--- nrpe-2.7.orig/init-script.in 2003-01-07 20:11:36.000000000 -0500
+++ nrpe-2.7/init-script.in 2008-05-30 17:19:30.000000000 -0400
@@ -24,6 +24,11 @@
# Source networking configuration.
. /etc/sysconfig/network
+# Read configuration (environment etc.) for nrpe and plugins
+if [ -f /etc/sysconfig/nrpe ]; then
+ . /etc/sysconfig/nrpe
+fi
+
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
--=-1XPP4ycUebFQkXsOXqCe--
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]