summaryrefslogtreecommitdiffstats
path: root/web/attachments/318691-check_mysql.patch
diff options
context:
space:
mode:
authorHolger Weiss <holger@zedat.fu-berlin.de>2013-09-29 22:03:24 (GMT)
committerHolger Weiss <holger@zedat.fu-berlin.de>2013-09-29 22:03:24 (GMT)
commit0b6423f9c99d9edf8c96fefd0f6c453859395aa1 (patch)
tree1c2b6b21704a294940f87c7892676998d8371707 /web/attachments/318691-check_mysql.patch
downloadsite-0b6423f9c99d9edf8c96fefd0f6c453859395aa1.tar.gz
Import Nagios Plugins site
Import the Nagios Plugins web site, Cronjobs, infrastructure scripts, and configuration files.
Diffstat (limited to 'web/attachments/318691-check_mysql.patch')
-rw-r--r--web/attachments/318691-check_mysql.patch19
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