diff options
Diffstat (limited to 'web/attachments/318691-check_mysql.patch')
-rw-r--r-- | web/attachments/318691-check_mysql.patch | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/web/attachments/318691-check_mysql.patch b/web/attachments/318691-check_mysql.patch new file mode 100644 index 0000000..1716c74 --- /dev/null +++ b/web/attachments/318691-check_mysql.patch | |||
@@ -0,0 +1,19 @@ | |||
1 | --- nagios-plugins-1.4.13/plugins/check_mysql.c 2008-08-16 06:47:32.000000000 +0200 | ||
2 | +++ nagios-plugins-1.4.13.oskar/plugins/check_mysql.c 2009-03-19 16:50:18.000000000 +0100 | ||
3 | @@ -181,13 +181,14 @@ | ||
4 | continue; | ||
5 | } | ||
6 | } | ||
7 | + | ||
8 | if ((slave_io_field < 0) || (slave_sql_field < 0) || (num_fields == 0)) { | ||
9 | mysql_free_result (res); | ||
10 | mysql_close (&mysql); | ||
11 | die (STATE_CRITICAL, "Slave status unavailable\n"); | ||
12 | } | ||
13 | |||
14 | - 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]); | ||
15 | + 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"); | ||
16 | if (strcmp (row[slave_io_field], "Yes") != 0 || strcmp (row[slave_sql_field], "Yes") != 0) { | ||
17 | mysql_free_result (res); | ||
18 | mysql_close (&mysql); | ||
19 | |||