MySQL: Monitoring MySQL with OpsDash

Quick Start

1. Install the OpsDash Smart Agent on the MySQL server that you wish to monitor. If you need instructions for how to do this, here they are:  Debian/UbuntuCentOS/RHELGeneric.

2. Create a user on the MySQL instance for OpsDash. This user needs PROCESS and REPLICATION CLIENT privileges to collect all relevant metrics:

mysql> CREATE USER opsdash@127.0.0.1 IDENTIFIED BY 'p@ssw0rd';
Query OK, 0 rows affected (0.00 sec)

mysql> GRANT PROCESS, REPLICATION CLIENT ON *.* TO opsdash@127.0.0.1;
Query OK, 0 rows affected (0.00 sec)

3. Edit the OpsDash Smart Agent configuration file at /etc/opsdash/agent.cfg and add a new service:

# choose a good, unique name for the service (here my-mysql-1 is used)
service "my-mysql-1" {
    type = "mysql"
    host = "127.0.0.1"
    user = "opsdash"
    pass = "p@ssw0rd"
}

4. Reload the OpsDash Smart Agent so that it picks up the new configuration:

sudo service opsdash-agent reload

5. You should see the service my-mysql-1 appear under https://app.opsdash.com/sources within a minute or so. Clicking on it should take you to the dashboard at https://app.opsdash.com/source/my-mysql-1. If it does not, check the agent log file at /var/log/opsdash/agent.log.

Notes

  • MySQL versions 5.5, 5.6 and 5.7 are supported.
  • You can install the OpsDash Smart Agent on any server that can connect to the MySQL instance -- change "127.0.0.1" accordingly in the above instructions.
  • You can also specify a port (port = 3306) in the service configuration block if needed.
  • The OpsDash Smart Agent will also collect and report metrics of the server itself, where it is installed. This will appear under the "Servers" section on the Sources page.