[Nagiosplug-devel] check_mysql should support a command line option for a MySQL defaults file
Brian A. Seklecki
bseklecki at collaborativefusion.com
Fri Nov 24 18:33:52 CET 2006
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.
~BAS
On Fri, 2006-11-24 at 00:37 +0100, Wolfram Schlich wrote:
> Hi!
>
> IMHO check_mysql currently lacks a command line option to specify an
> alternate MySQL defaults file (aka ~/.my.cnf).
> The 'mysql' command line program for example supports --defaults-file.
>
> 'check_mysql --help' itself warns about using '--password' in order
> to supply a password for MySQL authentication.
>
> Thus, the only secure and sane way to supply a password,
> and even more important, *different* passwords for checking *multiple*
> databases or MySQL servers, is via multiple specific MySQL
> defaults files.
>
> Example using '-f' as a possible command line option name:
>
> define command{
> command_name check_mysql
> command_line $USER1$/check_mysql -H $HOSTADDRESS$ -P $ARG1$ -u $ARG2$ -d $ARG3$ -f $ARG4$
> }
>
> define service{
> [...]
> host_name db1.example.com
> [...]
> check_command check_mysql!3306!nagios!mysql!/var/nagios/mysql.db1.example.com.cnf
> }
>
> define service{
> [...]
> host_name db2.example.com
> [...]
> check_command check_mysql!3306!nagios!mysql!/var/nagios/mysql.db2.example.com.cnf
> }
>
> Comments, please :-)
More information about the Devel
mailing list