MySQL monitor

This MySQL monitor type is capable of monitoring several key aspects of an MySQL database.

  • System type: All
  • Category: Database

NOTE   Only monitor specific settings are documented here. See Standard monitor settings.

Prerequisites

The MySQL Connector/C or MySQL Workbench packages must be installed on the Network Monitor server or gateway. Download and install the 32-bit client, even if your server is 64-bit. This is because Network Monitor is a 32-bit application and requires 32-bit drivers.

After installation ensure the file path to libMysql.dll is in the Windows system path. This is normally taken care of during installation of the administrator package, and might require a reboot of the server. The Network Monitornmservice.exe service must be restarted for the change to take effect. If Network Monitor cannot access this DLL file, the MySQL monitor fails with an error message specifying that it cannot find the libMysql.dll file.

If your MySQL server normally only responds to local queries, ie. your application is on the same server as the database, you may need to follow these simple steps to allow access for KNM to monitor your MySQL database.

  • Your MySQL server will need to respond to requests from a remote host. By default, the bind address is 127.0.0.1 so you need to change "bind-address" in your /etc/mysql/my.cnf to the correct IP address of your server, or comment out the row with # before the bind_address line for the server to listen on all IP addresses of your server.
  • By default, your client may not be allowed to connect to your database. To allow the client to connect to the database, follow these steps:
    1. SSH to your MySQL server
    2. mysql –u root –p
      Enter password
    3. Run the following query:

      use <database name>
      GRANT ALL ON *.* to root@’<ip address of your KNM host/gateway>’ IDENTIFIED BY ‘<your root password>’;
      FLUSH PRIVILEGES;

Monitor specific properties

These fields are required to connect to the database to perform configured tests.

  • Logon account - The logon account contains the credentials to use when authenticating with the MySQL database.
  • Port - Port number which the database server listens to.
  • Database name - Name of database to connect to.

Performance monitoring options

Leave these fields blank to not perform their tests.

  • Max thread count - A numeric value that represents the maximum number of running threads, if the number of running threads exceeds this value the monitor fails the test.
  • Max replication latency - A value in seconds that is the maximum difference in time between master and slave, if this time is exceeded the monitor fails the test.
  • Max slow queries - A slow query is defined as a query that has been running longer than the average time and exceeded the long_query_value time defined in the database configuration. Enter a numeric threshold value to make the test fail if the number of slow queries exceeds this value.
  • Max open tables - A numeric value that represents the maximum number of allowed open tables.
  • Queries per second average - A numeric value that represents the maximum number of running queries per seconds allowed.
  • Max users - Maximum number of users allowed to logon at the same time.

SQL query option

An optional SQL statement can be executed and its output compared to a predefined value using a compare operation.

  • SQL query - Optional SQL query to perform.
  • No rows fail - Check this option to make the monitor fail the test if the query returns no rows.
  • Compare value - Value to compare query result with.
  • Value type - Type of value that is compared with the retrieved from the database.
  • Operation - Operation to evaluate the returned query result and the compare value to determine if the test succeeded or failed.