FreeBSD Port: nagios-plugins-1.4,1
Gerrit Beine
gerrit.beine at gmx.de
Sun Feb 20 02:47:00 PST 2005
Hi,
this is a patch for check_mysql.
With MySQL 4.1 it returns wrong states for running replication slaves.
I fixed this and increased the size for the slave result to 50 characters.
It works fine on my host, I hope you like it.
So long...
Gerrit
-------------- next part --------------
--- plugins/check_mysql.c.orig Sun Dec 26 00:17:44 2004
+++ plugins/check_mysql.c Sun Feb 20 11:39:22 2005
@@ -19,7 +19,7 @@
const char *copyright = "1999-2004";
const char *email = "nagiosplug-devel at lists.sourceforge.net";
-#define SLAVERESULTSIZE 40
+#define SLAVERESULTSIZE 50
#include "common.h"
#include "utils.h"
@@ -126,7 +126,7 @@
} else {
/* mysql 4.x.x */
snprintf (slaveresult, SLAVERESULTSIZE, "Slave IO: %s Slave SQL: %s", row[9], row[10]);
- if (strcmp (row[9], "Yes") != 0 || strcmp (row[10], "Yes") != 0) {
+ if (strcmp (row[9], "Yes") != 0 && strcmp (row[10], "Yes") != 0) {
mysql_free_result (res);
mysql_close (&mysql);
die (STATE_CRITICAL, "%s\n", slaveresult);
More information about the freebsd-ports
mailing list