mysql unable to connect to database

Tim Dunphy <bluethundr-LLTpVw5dRsRWk0Htik3J/[email protected]>
Newsgroups gmane.network.nagios.plugins
Message-ID <0090490f-3087-4c9a-824a-a1c8ad55ba18@li289-212>
Hello,

 I'm trying to use the check_mysqld.pl plugin from the exchange.

 When I run the command from the nagios server on the command line it seems to succeed:

[root@cloud:/usr/local/nagios/etc/objects] #/usr/local/nagios/libexec/check_nrpe -H beta.domain.com -c check_mysqld
MYSQL 5.5.23 OK

But in the nagios web interface the check fails with a critical error:

CRITICAL ERROR - Unable to connect to database '' on server 'localhost' on port 3306 with user '' - Access denied for user 'nagios'@'localhost' (using password: NO) 

 If I run the plugin on the client end as the nagios user this is what the run looks like:

 [nagios@beta ~]$ /usr/local/nagios/libexec/check_mysqld.pl 
 MYSQL 5.5.23 OK



 In the command definition I did allow space for the username and password just in case I had a problem implementing it remotely:

# 'check_mysqld' command definition
define command{
        command_name    check_mysqld
      command_line    $USER1$/check_mysqld.pl -u $ARG1$ -p $ARG2$
}



My service definition was pretty straight forward:

# Define a service to check MYSQL on the local machine.define service{
        use                             local-service
        host_name                       beta
        service_description             MYSQL
        check_command                   check_mysqld
        notifications_enabled           0
        }

(leaving notifications disabled until I sort this out)


In my nrpe command definition on the client, this is what I have:

command[check_mysqld]=/usr/local/nagios/libexec/check_mysqld.pl -u root -p secret


So I am wondering why this check fails with the above error in the web interface when it succeeds on the command line as I have shown.

Thanks!
Tim



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Nagiosplug-help mailing list
Nagiosplug-help-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/nagiosplug-help
::: Please include plugins version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.