nagios init.d patch to set site-specific environment variables

sean finney seanius at seanius.net
Sat Jul 15 22:39:06 CEST 2006


hi nathan,

On Thu, Jul 13, 2006 at 12:43:38PM -0800, Vonnahme, Nathan wrote:
> I had trouble with the contrib/check_oracle_instance.pl plugin not
> picking up my ORACLE_HOME and LD_LIBRARY_PATH environment variables, so
> I patched the nagios daemon start/stop script in /etc/rc.d/init.d to
> read environment variables from a site-specific file named 'nagios_env'
> in the same directory as the .cfg files.

why not just set the environment variables in the init script itself?

> One thing I can't figure out is how to make 'make install-config' not
> overwrite the nagios_env file if you already have one; I think the whole
> point would be to not overwrite it when you upgrade etc.

if this is what you would want to do, you shouldn't ship the
optional env file at all, and have a block in the init script that
does something like:

if [ -r "$env_file" ]; then
	. $env_file
fi

thus, if someone wanted to override environment variables, they
could create that file and it would automatically be sourced.
otherwise, nothing would happen and the init script would continue.


	sean
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20060715/f3bd2fe1/attachment.sig>
-------------- next part --------------

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
-------------- next part --------------
_______________________________________________
Nagios-devel mailing list
Nagios-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-devel


More information about the Developers mailing list