From owner-freebsd-ports@FreeBSD.ORG Sun Feb 20 10:47:00 2005 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D611F16A4CE for ; Sun, 20 Feb 2005 10:47:00 +0000 (GMT) Received: from integratos.net (mail.integratos.net [80.243.45.83]) by mx1.FreeBSD.org (Postfix) with ESMTP id E633A43D1D for ; Sun, 20 Feb 2005 10:46:59 +0000 (GMT) (envelope-from gerrit.beine@gmx.de) Received: from [84.136.68.216] (account gerrit.beine@pitcom.de HELO [192.168.0.99]) by integratos.net (CommuniGate Pro SMTP 4.1.8) with ESMTP id 10282592; Sun, 20 Feb 2005 11:46:57 +0100 Message-ID: <42186A5C.9080108@gmx.de> Date: Sun, 20 Feb 2005 11:45:48 +0100 From: Gerrit Beine User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.5) Gecko/20050106 X-Accept-Language: en-us, en MIME-Version: 1.0 To: blaz@si.FreeBSD.org Content-Type: multipart/mixed; boundary="------------000109010808050709010006" cc: ports@FreeBSD.org Subject: FreeBSD Port: nagios-plugins-1.4,1 X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Feb 2005 10:47:00 -0000 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--