Description:
MEM 3.0.4 has a new feature of being able to identify instances based on the hostname they run on and the datadir the mysql is located at.
At least for the systems I work with this works much more conveniently than using the various uuid values it knows about (in mysql.inventory, or auto.cnf generated) especially as servers may be cloned from one location to another and if all the appropriate settings are not adjusted correctly MEM may get confused and ignore the "duplicate instance".
How to repeat:
Current configuration to use the hostname / datadir as a reference to the instance requires the agent to provide a --mysql-identity-source=host_and_datadir setting, so this behaviour must be configured on each agent, and existing agents need to have their configuration modified.
This seems rather awkward as I would not expect the agent to have knowledge of the server's configuration and it should be the server which decides how it wants to recognise an instance not the agent.
Suggested fix:
Please consider:
1. removing (or making this a no-op) the configuration of this setting on the agent. I would expect it when initially identifying itself to provide to the server information about the monitored instance and that would likely include the current auto.cnf (server_uuid) mysql.inventory settings and also the hostname and mysql instance's datadir.
2. Provide a check button that would allow me to check for servers which would be flagged as duplicate (or problematic) if this setting were to be enabled.
3. Provide a configuration setting on the MEM instance that determines how it will recognise an instance, so that if the DBA would like to use host_and_datadir as the instance identifier this would be done globally.
These settings would ensure the agent configuration is not more complex to setup, and would allow global control of how the new feature is used. Perhaps there are situations where you want to configure this at a per mysql instance level but it seems more logical to enable this sort of setting at a MEM server level.