Find Out How

Print Friendly Version

Monitoring MySQL

Prerequisites

In order to monitor a MySQL server, the SOASTA sBox must be able to establish a TCP/IP connection to the server. If you are not sure how to enable this, consult the MySQL reference manual.

If a firewall prevents TCP/IP access, see the topic Monitoring a Server Behind a Firewall and Additional Instructions for Monitoring a MySQL Server behind a Firewall below.

In addition, the MySQL account used by CloudTest must have the PROCESS privilege (this can be done using the GRANT statement).

 

Supported Versions

SOASTA CloudTest can currently monitor MySQL 4.x and MySQL 5.0.

 

Steps

  1. In the Central list, select Monitoring Server Groups.

Central list, Monitoring Server Groups

  1. Click the New Monitoring Server Group icon. The Monitoring Server / Monitor wizard appears:

New Monitor Server Group icon

  1. Select Monitor Server and click Next.  The Name and Connection step is shown.
 
  1. Type a name for the Monitoring Server and optionally provide a description.  Finally type the hostname or IP address of the server into the Host field and click Next.

 

  1. The Resources step is shown. Check "Databases" and click Next.

 

  1. Select MySQL, then enter the TCP/IP port number, the user name, and password.

 

  1. Click the Test Connection button to test the connection. If the connection is successful, you will see a pop-up containing some information about the MySQL server. If the connection fails, you will see an error message explaining what went wrong.
 
  1. Click Next.
 
  1. Review the information to be sure it is correct, then check the "Create a new Monitor for this Monitor Server" box and click Finish.

 

  1. Enter a name for the Monitor and an optional description, then click Next.

 

  1. At this point you can choose which statistics you are interested in. For each statistic, you can choose a "sample rate" which determines how often that statistic will be collected.
  • The "Commits" statistic tracks the number of database commits per second.
  • The "Rollbacks" statistic tracks the number of database rollbacks per second.
  • The "Total Connections" statistic tracks the number of users connected to the MySQL server. This will never be zero, because monitoring itself uses at least one connection.
  • The "Per Catalog Connections" statistic tracks the number of users connected to a specific MySQL database. If you use this statistic, you must enter the name of the database in the "Arguments" column.

 

When you are finished, click Next.

 

 

Review the information to be sure it is correct, then click Finish.

Next steps

You can also combine database, J2EE, and ColdFusion statistics in the same monitor.

Additional Instructions for Monitoring a MySQL Server behind a Firewall

In addition to the instructions described in Monitoring a Server Behind a Firewall, there are some extra required steps for MySQL. Specifically, the MySQL JDBC driver needs to be installed to the SOASTA Conductor application directory.

 

Steps

  1. The MySQL JDBC can be downloaded from http://downloads.mysql.com/archives.php?p=mysql-connector-java-5.1&v=5.1.6. The only supported version is 5.1.6. The latest version cannot be used.
  2. There is a single download for all operating systems.

 
  1. Unzip the compressed file. This will create a directory called mysql-connector-java-5.1.6.
 
  1. Inside the "mysql-connector-java-5.1.6" directory, find the file mysql-connector-java-5.1.6-bin.jar.
 
  1. Copy this file to the SOASTA Conductor directory. The exact directory depends on the operating system:
    • On Microsoft Windows, the default installation directory is C:\Program Files\SOASTA Conductor.
    • On Linux, the default installation directory is either /opt/Conductor if SOASTA Conductor was installed using the root account, or ~/Conductor if SOASTA Conductor was installed using a non-root account.
    • On Mac OS X, the default installation directory is /Applications/SOASTA Conductor. However, on Mac OS X, a special sub-directory must be used. Right-click the file "SOASTA Conductor.app" and choose "Show Package Contents" (see screen shot). From there, find the directory Contents/Resources/app and copy the MySQL JDBC driver to this directory.

  1. Re-start SOASTA Conductor if it is currently running.