[Nagiosplug-help] check_mysql not reading my.cnf?

Tad Martin teeboy at gmail.com
Fri May 1 20:32:32 CEST 2009


I have seen a couple other posts about this subject, but they don't appear
to be answered.  I am attempting to use the check_mysql plugin from 1.4.13
(plugin version 2034) with mysql client libraries from mysql 5.1.  I don't
want to pass the password via -p (whether it be through a $USER$ variable or
not), but the plugin doesn't seem to see the password= value in the .my.cnf
file present in ~nagios.

This is being attempted on Sun SPARC Solaris 10.  I have run a truss on the
check_mysql command, and it certainly seems to be reading the ~/.my.cnf file
that nagios seems to have (I see it open and read
/usr/local/nagios/.my.cnf).  I have even attempted to put the password in
/etc/my.cnf in the [client] section, but no go (not that I'd want to run
that way anyway).  I am able to use the mysql client directly from the
command line, and it reads the .my.cnf file without issue:

Examples:

(as user nagios)
$ mysql -h <hostip>
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 54
Server version: 5.0.45-log MySQL Community Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the current input
statement.

mysql>

Result:  mysql client can connect to the server without issue

$ /usr/local/nagios/libexec/check_mysql -H <hostip>
Access denied for user 'nagios'@'<monitor server hostname>' (using password:
NO)

Has anyone run into this and found a way to make it work?

Thank You
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-plugins.org/archive/help/attachments/20090501/39d695b4/attachment.html>


More information about the Help mailing list