summaryrefslogtreecommitdiffstats
path: root/plugins/check_mysql.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/check_mysql.c')
-rw-r--r--plugins/check_mysql.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/check_mysql.c b/plugins/check_mysql.c
index 119ce0a..689648e 100644
--- a/plugins/check_mysql.c
+++ b/plugins/check_mysql.c
@@ -177,13 +177,14 @@ main (int argc, char **argv)
177 continue; 177 continue;
178 } 178 }
179 } 179 }
180
180 if ((slave_io_field < 0) || (slave_sql_field < 0) || (num_fields == 0)) { 181 if ((slave_io_field < 0) || (slave_sql_field < 0) || (num_fields == 0)) {
181 mysql_free_result (res); 182 mysql_free_result (res);
182 mysql_close (&mysql); 183 mysql_close (&mysql);
183 die (STATE_CRITICAL, "Slave status unavailable\n"); 184 die (STATE_CRITICAL, "Slave status unavailable\n");
184 } 185 }
185 186
186 snprintf (slaveresult, SLAVERESULTSIZE, "Slave IO: %s Slave SQL: %s Seconds Behind Master: %s", row[slave_io_field], row[slave_sql_field], row[seconds_behind_field]); 187 snprintf (slaveresult, SLAVERESULTSIZE, "Slave IO: %s Slave SQL: %s Seconds Behind Master: %s", row[slave_io_field], row[slave_sql_field], seconds_behind_field!=-1?row[seconds_behind_field]:"Unknown");
187 if (strcmp (row[slave_io_field], "Yes") != 0 || strcmp (row[slave_sql_field], "Yes") != 0) { 188 if (strcmp (row[slave_io_field], "Yes") != 0 || strcmp (row[slave_sql_field], "Yes") != 0) {
188 mysql_free_result (res); 189 mysql_free_result (res);
189 mysql_close (&mysql); 190 mysql_close (&mysql);