[Nagiosplug-devel] check_mysql should support a command line option for a MySQL defaults file

Wolfram Schlich lists at wolfram.schlich.org
Sat Nov 25 14:59:49 CET 2006


* sean finney <seanius at seanius.net> [2006-11-24 20:53]:
> On Fri, 2006-11-24 at 12:33 -0500, Brian A. Seklecki wrote:
> > Yea it's always been beyond my belief why/if/that check_mysql doesn't
> > honor ~nagios/.my.cnf.  I remember the pain clearly.  Vivid.
> 
> doesn't it do so now?
> 
> <snip>
>         /* initialize mysql  */
>         mysql_init (&mysql);
> 
>         mysql_options(&mysql,MYSQL_READ_DEFAULT_GROUP,"client");
> <snip>

Yes, it does. But there is a problem with it :)

On Gentoo, the init script runs start-stop-daemon to start the nagios
daemon as user 'nagios', which is fine. But the nagios daemon
does not get the 'right' HOME environment variable, the home of the
user nagios for example, but instead HOME=/root.

So, I patched the init-script to add '-e HOME=/var/nagios' to the
start-stop-daemon call. Now, check_mysql (and others) get the
correct HOME and are able to use ~/.whatever files.
-- 
Wolfram Schlich




More information about the Devel mailing list