[icinga-users] problem with the mysql check

Mathieu Arnold mat at mat.cc
Wed Jan 18 09:36:18 CET 2017

Le 18/01/2017 à 07:06, Gerald Vogt a écrit :
> On 17/01/2017 22:10, Mathieu Arnold wrote:
>> Le 17/01/2017 à 21:36, Lee Clemens a écrit :
>>> I may have copied the wrong config, which specific check command are
>>> you using?
>>> Did you try setting the socket?
>>>         "-s" = "$mysql_socket$"
>> Your quote may have been wrong, but my answer still applies, using the
>> mysql check provided by icinga, the -H $mysql_hostname$ is *always* set,
>> and to use -s, -H must not be set.
> For a start it would be extremely helpful if you posted the
> distribution you use and the exact version of the check_mysql plugin.
> For check_mysql v2.1.4 on CentOS 7 it seems to be enough to set the
> hostname to "localhost" as long as the unix socket is in the default
> location:

It is 2.1.4 too, on FreeBSD.

> $ /usr/lib64/nagios/plugins/check_mysql -H localhost -u icinga -p
> password
> Uptime: 904  Threads: 2  Questions...
> I have skip_networking=ON, verified with network -lt that's not
> listening on a tcp socket. strace also shows it connects to the unix
> socket.
> Thus set vars.mysql_hostname = "localhost" in your service definition...

Ok, so, that works.
I could not have imagined that saying "localhost" would mean "do not
really use localhost but use the socket" so I never even tried it. Thanks.

Mathieu Arnold

More information about the icinga-users mailing list