check_mysql not using ~nagios/.my.cnf on ubuntu 6.0.6 with nagios 2.3.1

John Breen jbreen at hgait.net.au
Wed May 31 05:46:54 CEST 2006


I am using nagios 2.3.1 with nagios-plugins-plugins-1.4.3 on an Ubuntu 
6.06 server.

I am using check_mysql, compiled on this server against 
libmysqlclient15, to check the status of mysql on two other servers.

I have created a .my.cnf file in ~nagios, and when I run check_mysql -H 
<hostname> from the command line as the nagios user all goes well.  
However, when I automate this in my checkcommands.cfg, I get errors and 
nagios tells me the server is down.

~nagios/.my.cnf has looks like this:

[client]
password = "<password>"

The block in checkcommands.cfg looks like this:

# check_mysql command definition.
define command{
       command_name    check_mysql
       command_line    $USER1$/check_mysql -H $HOSTADDRESS$
       }


When I run check_mysql from the commandline against the host, I get

nagios at monitor-server:~nagios/$ check_mysql -H mysql-server
Uptime: 426469  Threads: 2  Questions: 18075  Slow queries: 0  Opens: 0  
Flush tables: 1  Open tables: 64  Queries per second avg: 0.042

But when I do it automatically via checkcommands.cfg, i get

Access denied for user 'nagios'@'monitor-server.voipwa.net.au' (using 
password: NO)

If I add the -p <password> to the checkcommands.cfg, everything works.

The user has been added and has sufficient privileges on the mysql 
server to get a database connection, so everything should be ok there.  
nagios is running as the user nagios (checked with ps), so that should 
be ok.
I was under the impression that check_mysql should use the 
~nagios/.my.cnf file for its login information, is this not the case?

-- 
Kind Regards,
John Breen

HGAIT
Tel: 08 9425 5233
Fax: 08 9425 5255
Level 9, 256 Adelaide Terrace, Perth, WA 6000
Postal P.O.Box 1240, West Perth, WA, 6872


The information in this E-mail is confidential. If you are not the named
& intended recipient, you must not read, use, copy, disclose or
disseminate this E-mail, any attachments or the information contained in
this E-mail and must immediately notify the sender & delete this E-mail
immediately. Although HGAIT believes that this E-mail and any
attachments are free of any virus or other defect which may affect a
computer, it is the responsibility of the recipient to ensure that it is
virus free. HGAIT does not accept any responsibility for any loss or
damage arising in any way from the use of this E-mail or any
attachments.



IMPORTANT INFORMATION

This is not a SPAM. The SPAM Act 2003 commenced on the 10th April 2004
and requires consent to the sending of most commercial electronic
messages. If you wish to continue receiving electronic communications
from HGAIT, you do not need to take any action.



If you DO NOT wish to continue receiving electronic communications from
HGAIT please advise us at admin at hgait.net.au and we will update our
records accordingly.




-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list