Skip to content

Enforce socket protocol in mk_mysql #821

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jnweiger
Copy link

With multiple instances per host the plugin may or may not show the correct data for each instance. It may happen, that all graphs show the same instance.

This depends on the mysql client tool. It has some builtin logic to decide if it prefers TCP Port connctions or socket connections.

E.g. on debian 12, mariadb-client-10.11.11 the behaviour depends on how the host is specified. With host=localhost, the socket is used, with host=127.0.0.1 the (default) TCP port 3306 is used.

When setting up the plugin in the agent bakery, the prefilled host field reads 127.0.0.1 and thus caused me to see false data for my second instance (as both were queried at the same default TCP port).

I suggest to always use the --protocol=socket option together with the --socket=.... option. This enforces that the specified socket parameter is actually used.

The --protocol=socket option exists with all mysql mysaladmin tools since version 4.1 (and also in mariadb / mariadbadmin)

Thank you for your interest in contributing to Checkmk!
Consider looking into Readme regarding process details.

General information

Please give a brief summary of the affected device, software or appliance.
Keep in mind that we are experts in monitoring, but we cannot be experts on all supported devices.
A little context will help us assess your proposed change.

Bug reports

Please include:

  • Your operating system name and version
  • Any details about your local setup that might be helpful in troubleshooting
  • Detailed steps to reproduce the bug
  • An agent output or SNMP walk
  • The ID of a submitted crash report for reference (if applicable)

Proposed changes

Sometimes it is hard for us to assess the quality of a fix.
While it may work for you, it is our job to ensure that it works for everybody.
These are some ways to help us:

  • What is the expected behavior?
  • What is the observed behavior?
  • If it's not obvious from the above: In what way does your patch change the current behavior?
  • Consider writing a unit test that would have failed without your fix.
  • Is this a new problem? What made you submit this PR (new firmware, new device, changed device behavior)?

With multiple instances per host the plugin may or may not show the correct data for each instance. It may happen, that all graphs show the same instance.

This depends on the mysql client tool. It has some builtin logic to decide if it prefers TCP Port connctions or socket connections.

E.g. on debian 12, mariadb-client-10.11.11 the behaviour depends on how the host is specified.
With host=localhost, the socket is used, with host=127.0.0.1 the (default) TCP port 3306 is used.

When setting up the plugin in the agent bakery, the prefilled host field reads 127.0.0.1 and thus caused me to see false data for my second instance (as both were queried at the same default TCP port).

I suggest to always use the --protocol=socket option together with the --socket=.... option. This enforces that the specified socket parameter is actually used.

The --protocol=socket option exists with all mysql mysaladmin tools since version 4.1 (and also in mariadb / mariadbadmin)
Copy link

github-actions bot commented May 23, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@jnweiger
Copy link
Author

I have read the CLA Document and I hereby sign the CLA or my organization already has a signed CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants