diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/check_mysql.c | 10 |
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) | |||
123 | die (STATE_CRITICAL, "%s\n", slaveresult); | 123 | die (STATE_CRITICAL, "%s\n", slaveresult); |
124 | } | 124 | } |
125 | 125 | ||
126 | } else if (mysql_field_count (&mysql) == 33) { | ||
127 | /* mysql >= 4.1.1 */ | ||
128 | snprintf (slaveresult, SLAVERESULTSIZE, "Slave IO: %s Slave SQL: %s", row[10], row[11]); | ||
129 | if (strcmp (row[10], "Yes") != 0 || strcmp (row[11], "Yes") != 0) { | ||
130 | mysql_free_result (res); | ||
131 | mysql_close (&mysql); | ||
132 | die (STATE_CRITICAL, "%s\n", slaveresult); | ||
133 | } | ||
126 | } else { | 134 | } else { |
127 | /* mysql 4.x.x */ | 135 | /* mysql 4.0.x or 4.1.0 */ |
128 | snprintf (slaveresult, SLAVERESULTSIZE, "Slave IO: %s Slave SQL: %s", row[9], row[10]); | 136 | snprintf (slaveresult, SLAVERESULTSIZE, "Slave IO: %s Slave SQL: %s", row[9], row[10]); |
129 | if (strcmp (row[9], "Yes") != 0 || strcmp (row[10], "Yes") != 0) { | 137 | if (strcmp (row[9], "Yes") != 0 || strcmp (row[10], "Yes") != 0) { |
130 | mysql_free_result (res); | 138 | mysql_free_result (res); |