[ SOLVED ] nagios problem after migration to version 3

Marc Powell marc at ena.com
Wed Oct 21 17:46:23 CEST 2009


On Oct 21, 2009, at 10:03 AM, J. Bakshi wrote:

> Asaf I have no idea why -H parameter is not working here !!!  But if I
> just remove  * -H $HOSTADDRESS$ *  and  modify service definition as
>
> check_mysql!root!password123
>
> and it works perfectly ok.

Only because check_mysql defaults to connecting to localhost (via  
socket I believe) if no -H parameter is specified.

> Though I think * -H $HOSTADDRESS$ * should
> work where mysql needs a specific hostname to log in successfully. Any
> workaround to make * -H $HOSTADDRESS$ * working ?

Make sure that in your *host* definition, the *address* is 'localhost'  
or '127.0.0.1'. Your real problem has nothing to do with nagios. You  
have access restrictions enabled within your mysql database such that  
it only permits accesses that originate from localhost.

localhost is not the same as the local ethernet IP.

When any program makes a TCP connection, the OS uses a source IP of  
the ethernet interface that leads to that IP.

When you connect to localhost, the OS uses a source IP of localhost  
(127.0.0.1) because that is the interface that leads to that address.  
You have configured mysql to permit connections from this source.

When you connect to mysql on the 192.168.1.1 IP (as specified in the  
host definition), your OS uses a source address of 192.168.1.1 because  
that interface leads to that address. You have configured mysql to  
*reject* connections from this source. You should permit connections  
from this source if you want to use the ethernet IP as the -H  
parameter for check_mysql.

You'll know you have it right when you can issue the mysql command  
'mysql -H 192.168.1.1 -u root -p' and log in.

--
Marc


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
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