Enforce socket protocol in mk_mysql #821
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
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: