Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Feb 2005 11:45:48 +0100
From:      Gerrit Beine <gerrit.beine@gmx.de>
To:        blaz@si.FreeBSD.org
Cc:        ports@FreeBSD.org
Subject:   FreeBSD Port: nagios-plugins-1.4,1
Message-ID:  <42186A5C.9080108@gmx.de>

next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------000109010808050709010006
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

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

--------------000109010808050709010006
Content-Type: text/plain;
 name="patch-check_mysql.c"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="patch-check_mysql.c"

--- 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@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);

--------------000109010808050709010006--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?42186A5C.9080108>