diff options
Diffstat (limited to 'web/attachments/123084-patch-check_mysql.c')
-rw-r--r-- | web/attachments/123084-patch-check_mysql.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/web/attachments/123084-patch-check_mysql.c b/web/attachments/123084-patch-check_mysql.c new file mode 100644 index 0000000..998ad47 --- /dev/null +++ b/web/attachments/123084-patch-check_mysql.c | |||
@@ -0,0 +1,20 @@ | |||
1 | --- plugins/check_mysql.c.orig Sun Dec 26 00:17:44 2004 | ||
2 | +++ plugins/check_mysql.c Sun Feb 20 14:12:10 2005 | ||
3 | @@ -123,8 +123,16 @@ | ||
4 | die (STATE_CRITICAL, "%s\n", slaveresult); | ||
5 | } | ||
6 | |||
7 | + } else if (mysql_field_count (&mysql) == 33) { | ||
8 | + /* mysql >= 4.1.1 */ | ||
9 | + snprintf (slaveresult, SLAVERESULTSIZE, "Slave IO: %s Slave SQL: %s", row[10], row[11]); | ||
10 | + if (strcmp (row[10], "Yes") != 0 || strcmp (row[11], "Yes") != 0) { | ||
11 | + mysql_free_result (res); | ||
12 | + mysql_close (&mysql); | ||
13 | + die (STATE_CRITICAL, "%s\n", slaveresult); | ||
14 | + } | ||
15 | } else { | ||
16 | - /* mysql 4.x.x */ | ||
17 | + /* mysql 4.0.x or 4.1.0 */ | ||
18 | snprintf (slaveresult, SLAVERESULTSIZE, "Slave IO: %s Slave SQL: %s", row[9], row[10]); | ||
19 | if (strcmp (row[9], "Yes") != 0 || strcmp (row[10], "Yes") != 0) { | ||
20 | mysql_free_result (res); | ||