Documentation Home
MySQL Enterprise Monitor 8.0 Manual
Related Documentation Download this Manual

7.4 Changing an SSH Host Key

The SSH Host key is used to distinguish monitored hosts, there should not be duplicate SSH keys. A key can be duplicated if a server is cloned. This section describes how to change the SSH host key for a particular host, eliminating the events and alarms generated when duplicate hosts are detected.

The following steps must be performed:

  • Generate a new SSH key for the monitored host.

  • Edit the monitoring agent's configuration.

  • Edit the hostid in the MySQL Enterprise Service Manager repository.

On UNIX, Linux and Mac OS platforms, use the ssh-keygen utility. On Microsoft Windows platforms, there are several tools, but this example uses puttygen.

To generate a new SSH key for the monitored host, do the following:

  1. On the monitored host, generate an SSH key. For example:

    shell> ssh-keygen -t rsa -N ''' -f /etc/ssh/ssh_host_key

    If using puttygen, click Generate and follow the instructions on-screen.

    Note

    The key can be generated using RSA (SSH1 or SSH2), DSA, or ECDSA. All are supported by MySQL Enterprise Monitor.

  2. Retrieve the key fingerprint.

    The fingerprint is an alphanumeric string similar to the following:

    5a:86:16:fb:2e:16:e8:21:ef:07:ee:6c:fc:4f:84:e5

    On UNIX-based platforms, retrieve this value with the following command:

    shell> ssh-keygen -l -f /path/to/key/filename.pub

    On Windows platforms, using puttygen, this value is in the Key Fingerprint field.

  3. Stop the monitoring agent.

  4. Open the monitoring agent's bootstrap.properties configuration file, and add, or edit, the following value:

    agent-host-id=ssh:{New SSH Fingerprint}

    For example, using the fingerprint listed above:

    agent-host-id=ssh:{5a:86:16:fb:2e:16:e8:21:ef:07:ee:6c:fc:4f:84:e5}
  5. On the MySQL Enterprise Service Manager machine, edit the hostid value in the repository:

    mysql> UPDATE mysql.inventory SET VALUE = 'ssh:{New SSH Fingerprint}' WHERE name = 'hostId';
  6. Restart the monitoring agent.