From owner-freebsd-ports@FreeBSD.ORG Sun Feb 20 15:24:15 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 C936B16A4CE for ; Sun, 20 Feb 2005 15:24:15 +0000 (GMT) Received: from integratos.net (mail.integratos.net [80.243.45.83]) by mx1.FreeBSD.org (Postfix) with ESMTP id 651F543D39 for ; Sun, 20 Feb 2005 15:24:14 +0000 (GMT) (envelope-from tux@pinguru.net) Received: from [80.243.46.153] (account gerrit.beine@pitcom.de HELO [80.243.46.153]) by integratos.net (CommuniGate Pro SMTP 4.1.8) with ESMTP id 10291793; Sun, 20 Feb 2005 16:24:13 +0100 Message-ID: <4218AB5C.7000302@pinguru.net> Date: Sun, 20 Feb 2005 16:23:08 +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 References: <42186A5C.9080108@gmx.de> In-Reply-To: <42186A5C.9080108@gmx.de> Content-Type: multipart/mixed; boundary="------------090007070201030006010109" cc: ports@FreeBSD.org Subject: Re: 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 15:24:15 -0000 This is a multi-part message in MIME format. --------------090007070201030006010109 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Gerrit Beine wrote: > Hi, > After taking a look into MySQL manual I changed the patch. MySQL 4.0.x and MySQL 4.1.0 have only 16 columns in SHOW SLAVE STATUS, MySQL 4.1.1 and greater 33 columns. So it is possible to switch between the versions. So long... Gerrit --------------090007070201030006010109 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 14:12:10 2005 @@ -123,8 +123,16 @@ die (STATE_CRITICAL, "%s\n", slaveresult); } + } else if (mysql_field_count (&mysql) == 33) { + /* mysql >= 4.1.1 */ + snprintf (slaveresult, SLAVERESULTSIZE, "Slave IO: %s Slave SQL: %s", row[10], row[11]); + if (strcmp (row[10], "Yes") != 0 || strcmp (row[11], "Yes") != 0) { + mysql_free_result (res); + mysql_close (&mysql); + die (STATE_CRITICAL, "%s\n", slaveresult); + } } else { - /* mysql 4.x.x */ + /* mysql 4.0.x or 4.1.0 */ snprintf (slaveresult, SLAVERESULTSIZE, "Slave IO: %s Slave SQL: %s", row[9], row[10]); if (strcmp (row[9], "Yes") != 0 || strcmp (row[10], "Yes") != 0) { mysql_free_result (res); --------------090007070201030006010109--