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

Wolfram Schlich lists at wolfram.schlich.org
Fri Nov 24 00:37:46 CET 2006


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 :-)
-- 
Regards,
Wolfram Schlich <wschlich at gentoo.org>
Gentoo Linux * http://dev.gentoo.org/~wschlich/




More information about the Devel mailing list