aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/check_mysql.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/plugins/check_mysql.c b/plugins/check_mysql.c
index 735eaa2e..25b7d7e6 100644
--- a/plugins/check_mysql.c
+++ b/plugins/check_mysql.c
@@ -123,8 +123,16 @@ main (int argc, char **argv)
die (STATE_CRITICAL, "%s\n", slaveresult);
}
+ } else if (mysql_field_count (&mysql) == 33) {
+ /* mysql >= 4.1.1 */
+ snprintf (slaveresult, SLAVERESULTSIZE, "Slave IO: %s Slave SQL: %s", row[10], row[11]);
+ if (strcmp (row[10], "Yes") != 0 || strcmp (row[11], "Yes") != 0) {
+ mysql_free_result (res);
+ mysql_close (&mysql);
+ die (STATE_CRITICAL, "%s\n", slaveresult);
+ }
} else {
- /* mysql 4.x.x */
+ /* mysql 4.0.x or 4.1.0 */
snprintf (slaveresult, SLAVERESULTSIZE, "Slave IO: %s Slave SQL: %s", row[9], row[10]);
if (strcmp (row[9], "Yes") != 0 || strcmp (row[10], "Yes") != 0) {
mysql_free_result (res);