Mk_mysql plugin

Hello,

I would like to first express my astonishment at the Checkmk product. It’s quite a monitoring system!

I am still in the testing period and I’ve come across something, that I am unable to figure out.

The mk_mysql plugin provides a ton of information, however, it is by:

  • socket
  • alias

This is great if you have multiple instances indeed, however, if I set it up on a single MySQL service I get 4 different checks for example:

Mysql version /var/run/mysqld/mysqld2.sock → The version
Mysql Version Alias1 > The version
Mysql Version Alias2 > The version
Mysql Version mysql > The version

And this is the same for the database sizes, the Innodb stats, etc.

How can I limit this to only local connections by using username/password, without any sockets, or aliases?

Thank you so much for the time taken for a reply.

Have a good day/night.

Best Regards,

Marcus

You can create a configuration file for this agent plugin: /etc/check_mk/mysql.cfg

Or you use the agent bakery in the Enterprise Edition for that.

In the config file the plugin can be told to connect to specific instances. Examples are here: checkmk/agents/cfg_examples/mysql.cfg at master · Checkmk/checkmk · GitHub

Hello,

Thanks a lot for the guidance. I’ve edited the mysql.cfg and now indeed the additional services are gone, but I still have:

MySQL Instance /var/run/mysqld/mysqld2.sock amysqladmin: connect to server at ‘localhost’ failed
MySQL Instance Alias1 amysqladmin: connect to server at ‘localhost’ failed
MySQL Instance Alias3 amysqladmin: connect to server at ‘localhost’ failed

Do I need to disable these checks or there are additional modifications that I can make?

My mysql.cfg looks like this:

[client]
user=asdfasdfasdf
password=“asdfasdfasdf”

#host=127.0.0.1
#!include /etc/check_mk/mysql.local.cfg
#[check_mk]

There is always one alias per socket which can also be empty

Example with three sockets, the second one has an empty alias:

[client]

user=monitoring

password=“password”

socket=/var/run/mysqld/mysqld.sock

socket=/var/run/mysqld/mysqld2.sock

socket=/var/run/mysqld/mysqld3.sock

host=127.0.0.1

!include /etc/check_mk/mysql.local.cfg

[check_mk]

aliases=Alias1,Alias3

Thank you!

Regards,

Marcus

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.