[Nagiosplug-help] Need help using check_mysql

tom.welsh at bt.com tom.welsh at bt.com
Wed Sep 12 21:59:43 CEST 2007


Hi Kevin.

This is quite probably a mysql setup problem. Does the mysql database
allow outside connections or just localhost ones?

Check /etc/my.cnf and see if skip networking id uncommented

# Don't listen on a TCP/IP port at all. This can be a security
enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named
pipes.
# Note that using this option without enabling named pipes on Windows
# (via the "enable-named-pipe" option) will render mysqld useless!
#
skip-networking

See my examples which I have just run on my own system

1. With skip-networking enabled

#./check_mysql -H localhost -u nagios -p 6t5Bl0wz
Uptime: 622227  Threads: 1  Questions: 158  Slow queries: 0  Opens: 130
Flush tables: 1  Open tables: 8  Queries per second avg: 0.000

# ./check_mysql -H 132.146.190.32 -u nagios -p 6t5Bl0wz
Can't connect to MySQL server on '132.146.190.32' (111)

2. edit /etc/my.cnf and comment out skip-networking
# vi /etc/my.cnf

3. restart mysql
# /etc/init.d/mysql restart
Shutting down MySQL..
done
Starting MySQL
done

4. test again with IP address
 # ./check_mysql -H 132.146.190.32 -u nagios -p 6t5Bl0wz
Uptime: 4  Threads: 1  Questions: 1  Slow queries: 0  Opens: 12  Flush
tables: 1  Open tables: 6  Queries per second avg: 0.250



-----Original Message-----
From: nagiosplug-help-bounces at lists.sourceforge.net
[mailto:nagiosplug-help-bounces at lists.sourceforge.net] On Behalf Of
Zembower, Kevin
Sent: 12 September 2007 20:27
To: nagiosplug-help at lists.sourceforge.net
Subject: [Nagiosplug-help] Need help using check_mysql

I'm trying to configure check_mysql on my Debian etch system:
cn2:/etc/nagios2/conf.d# /usr/lib/nagios/plugins/check_mysql -V
check_mysql (nagios-plugins 1.4.5) 1.33

I can't get the check to work unless I use the defaults:
cn2:/etc/nagios2/conf.d# /usr/lib/nagios/plugins/check_mysql -H
10.253.192.205 -u nagios -p secret
Can't connect to MySQL server on '10.253.192.205' (111)
cn2:/etc/nagios2/conf.d# /usr/lib/nagios/plugins/check_mysql -H
localhost -u nagios -p secret
Uptime: 2000705  Threads: 1  Questions: 3546235  Slow queries: 0  Opens:
18915  Flush tables: 1  Open tables: 64  Queries per second avg: 1.772
cn2:/etc/nagios2/conf.d# /usr/lib/nagios/plugins/check_mysql -u nagios
-p secret
Uptime: 2000710  Threads: 1  Questions: 3546236  Slow queries: 0  Opens:
18915  Flush tables: 1  Open tables: 64  Queries per second avg: 1.772
cn2:/etc/nagios2/conf.d#

I think I've got the IP address right:
cn2:/etc/nagios2/conf.d# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:B0:D0:49:55:20  
          inet addr:10.253.192.205  Bcast:10.253.192.255
Mask:255.255.255.192
<snip>

I first thought that this could be caused by the 'nagios' MySQL user,
but I have this user defined for all hosts:
kevinz at cn2:~$ mysql -A mysql
Server version: 5.0.32-Debian_7etch1-log Debian etch distribution

mysql> select * from user where User like 'nagios%'\G
*************************** 1. row ***************************
                 Host: %
                 User: nagios
             Password: <snip>
          Select_priv: N
          Insert_priv: N
          Update_priv: N
          Delete_priv: N
          Create_priv: N
            Drop_priv: N
          Reload_priv: N
        Shutdown_priv: N
         Process_priv: N
            File_priv: N
           <snip>
1 row in set (0.00 sec)

mysql>

Can anyone help me get check_mysql working from the command line?

Thanks for all your help and suggestions.

-Kevin

Kevin Zembower
Internet Services Group manager
Center for Communication Programs
Bloomberg School of Public Health
Johns Hopkins University
111 Market Place, Suite 310
Baltimore, Maryland  21202
410-659-6139 

------------------------------------------------------------------------
-
This SF.net email is sponsored by: Microsoft Defy all challenges.
Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Nagiosplug-help mailing list
Nagiosplug-help at lists.sourceforge.net
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




More information about the Help mailing list