This is a module for monitoring the MySQL SQL database server health (latest versions in the 3.23 or 4 series). Carefully chosen relevant indicators are displayed, allowing the administrator to set meaningful thresholds.

It requires the mysqltcl package (at http://www.xdobry.de/mysqltcl/) for connection via the native MySQL protocol, or the tclodbc package (at http://sourceforge.net/projects/tclodbc) for connection via ODBC (Open DataBase Connectivity).

Note that although this module is for Linux, the MySQL server to be monitored could be running on any remote machine, even a Windows one.

Data is drawn from the SHOW STATUS and SHOW VARIABLES query results and initially displayed in 1 table:

view of the myhealth module tables

There are 2 data columns:

The data rows are:

Optimizing queries:

Please see the MySQL documentation about optimizing queries and the EXPLAIN command.
Use EXPLAIN to get see what is wrong. Do it not just for SELECT queries but also for UPDATE and DELETE queries.
For example, on a query such as:

UPDATE table SET ... WHERE x = 0
try:
EXPLAIN SELECT * FROM table WHERE x = 0

Module options:

Examples:

$ moodss myhealth --host 1.2.3.4
$ moodss myhealth --host dbserver.company.com --port 3307
$ moodss myhealth --host dbserver.company.com --user status --password xxx
$ moodss myhealth --dsn mydb --user status --password xxx