From nobody@FreeBSD.org  Fri Dec 13 14:25:56 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTPS id DDFF57E2
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 13 Dec 2013 14:25:56 +0000 (UTC)
Received: from oldred.freebsd.org (oldred.freebsd.org [IPv6:2001:1900:2254:206a::50:4])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id CAAE51D79
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 13 Dec 2013 14:25:56 +0000 (UTC)
Received: from oldred.freebsd.org ([127.0.1.6])
	by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id rBDEPu0n086794
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 13 Dec 2013 14:25:56 GMT
	(envelope-from nobody@oldred.freebsd.org)
Received: (from nobody@localhost)
	by oldred.freebsd.org (8.14.5/8.14.5/Submit) id rBDEPuHl086783;
	Fri, 13 Dec 2013 14:25:56 GMT
	(envelope-from nobody)
Message-Id: <201312131425.rBDEPuHl086783@oldred.freebsd.org>
Date: Fri, 13 Dec 2013 14:25:56 GMT
From: Glen Barber <gjb@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] net-mgmt/nagios-plugins: Fix check_dns plugin on OSVERSION >= 1000000
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         184749
>Category:       ports
>Synopsis:       [patch] net-mgmt/nagios-plugins: Fix check_dns plugin on OSVERSION >= 1000000
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    mat
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Dec 13 14:30:00 UTC 2013
>Closed-Date:    Mon Apr 14 18:06:33 UTC 2014
>Last-Modified:  Mon Apr 14 18:06:33 UTC 2014
>Originator:     Glen Barber
>Release:        FreeBSD 11.0-CURRENT r258761
>Organization:
The FreeBSD Foundation
>Environment:
FreeBSD nucleus 11.0-CURRENT FreeBSD 11.0-CURRENT #194 r258761: Wed Dec  4 09:23:20 EST 2013     root@nucleus:/usr/obj/usr/src/sys/NUCLEUS  amd64
>Description:
check_dns.c hard-codes the path to nslookup(1) to /usr/bin/nslookup, which does not exist by default on head/, stable/10/, or releng/10.0/.

This causes the check_dns plugin to fail, outputting the following:
"DNS CRITICAL - '/usr/bin/nslookup -sil' msg parsing exited with no address"
>How-To-Repeat:

>Fix:
Attached patch resolves the issue.

Patch attached with submission follows:

Index: net-mgmt/nagios-plugins/Makefile
===================================================================
--- net-mgmt/nagios-plugins/Makefile	(revision 336347)
+++ net-mgmt/nagios-plugins/Makefile	(working copy)
@@ -3,6 +3,7 @@
 
 PORTNAME=	nagios-plugins
 PORTVERSION=	1.5
+PORTREVISION=	1
 PORTEPOCH=	1
 CATEGORIES=	net-mgmt
 MASTER_SITES=	https://www.nagios-plugins.org/download/
@@ -56,6 +57,10 @@
 		--sysconfdir=${PREFIX}/etc/nagios \
 		--localstatedir=${NAGIOSDIR} \
 		--prefix=${PREFIX}
+.if(${OSVERSION} >= 1000000)
+CONFIGURE_ARGS+=--with-nslookup-command=${PREFIX}/bin/nslookup
+BUILD_DEPENDS+=	nslookup:${PORTSDIR}/dns/bind-tools
+.endif
 
 CONFIGURE_ENV=	PERL=${PERL}
 CPPFLAGS+=	-I${LOCALBASE}/include


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->demon 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Fri Dec 13 14:30:08 UTC 2013 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=184749 

From: Glen Barber <gjb@FreeBSD.org>
To: bug-followup@FreeBSD.org
Cc: demon@FreeBSD.org
Subject: Re: ports/184749: [patch] net-mgmt/nagios-plugins: Fix check_dns
 plugin on OSVERSION >= 1000000
Date: Fri, 13 Dec 2013 09:32:24 -0500

 --7mjWZ9NKzhEjSVTm
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 Redports build result is here:
 
     https://redports.org/buildarchive/20131213140800-19114
 
 Note, the leftovers on the 10.x builds are from dns/bind-tools, not the
 proposed change.
 
 Glen
 
 
 --7mjWZ9NKzhEjSVTm
 Content-Type: application/pgp-signature
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (FreeBSD)
 
 iQIcBAEBCAAGBQJSqxp4AAoJELls3eqvi17QEjkP/3oeRh/XuSzgOC+eUEhpQO49
 V/rfu3kPAgNf98JvH200l/VEaSFZhRw2vlYVO7ZxgbRg5ifk0KFUVDruMm0PQU+S
 9TD2LlpkYHQVOlrlaXI2Lr6iwsQOwqP45MvVxD8ONYEByswtR6NIUdvlIG+Ez3DB
 +pqQ+YA1g8nIbJNUpg3edU0H44HYwDMJTqMyLzCrdT8BBcPPa7FfKq1i4nwoISKJ
 4U+79QvXhpwkXVJn7dGOmw3Ku3vNwl/6EUaFNGgHcVWPmT8Qnnt4XQSVNMcJEgmW
 X4Lz3h0aJa3up/ZaGzmRwInIabvgXH3MfvZA2FBeBp++7SGx42K0ikTowIIVKkJ2
 nquMS5nzQ/OiYjjIxfU9snu3bx06fR+zstF8UF/m5yvryl8uE8TnOhO6AsNP/QsI
 10NKjQiVOvc9rfcgCGHeTfJy5SEWSjSIEMvJGsF/XpExSjk/bOETSspJn3jibMCs
 vQDCG5Wy4t6oaqxuONA763JCdCuAbfhjhsCGPNfu5LU2wwg7u6B3Vr9ZmEdA6YLF
 nvauhJFsipcsvx0jfkFnYtryrt0+1O12n/vTsf7t5g2ecCTZ0O3MYjq/smO5l2+K
 PYywLwHh8ZucftiE9hsT7amWEd6j1urqYAAzIXyXpcx1kjTpvvqbFeCluosHFoOh
 3S//QVvv30E6sqjXUA0W
 =9E/f
 -----END PGP SIGNATURE-----
 
 --7mjWZ9NKzhEjSVTm--

From: Dmitry Sivachenko <demon@FreeBSD.org>
To: bug-followup@FreeBSD.org,
 Glen Barber <gjb@FreeBSD.org>
Cc:  
Subject: Re: ports/184749: [patch] net-mgmt/nagios-plugins: Fix check_dns plugin on OSVERSION &gt;= 1000000
Date: Fri, 13 Dec 2013 19:36:11 +0400

 Some people already have dns/bindXX port installed (which also has =
 nslookup binary) and you patch will require bind-tools dependency =
 (bind-tools conflicts with bindXX).
 
 I am aware of this problem but I still don=92t know how to properly =
 depend on either bind-tools or bindXX port.
 
 mat@ suggested that probably drill(1) can be used instead of nslookup on =
 FreeBSD-10, but this is still untested.=

From: Alexander Wittig <alexander@wittig.name>
To: bug-followup@FreeBSD.org,
 gjb@FreeBSD.org
Cc:  
Subject: Re: ports/184749: [patch] net-mgmt/nagios-plugins: Fix check_dns plugin on OSVERSION &gt;= 1000000
Date: Sat, 14 Dec 2013 20:19:24 +0100

 Hi
 
 I found this bug report after stumbling into the same issue after =
 updating my system from 9.2 to 10-RC. I get an error during installing =
 from port indicating that the check_dns and check_dig plugins are =
 missing. This is true, as configure picks up on the missing nslookup&dig =
  and never builds them, but they are both listed in pkg-plist.
 
 So apart from the nslookup problem (in check_dns) the exact same issue =
 also exists with dig (in check_dig). If a patch similar to the one =
 suggested by gjb@ is finally accepted, it should also include
 --with-dig-command=3D${PREFIX}/bin/dig
 in the configure arguments to fix both plugins at the same time.
 
 
 A quick workaround to regain at least one working DNS check plugin on =
 FBSD 10 is to replace dig with drill in check_dig as suggested by mat@. =
 It=92s easy as the two tools seem to have identical output and only very =
 minor differences in the command line syntax. To get it working I added =
 --with-dig-command=3D${PREFIX}/bin/drill to configure and changed line =
 91 in plugins/check_dig.c to match the drill syntax (just remove the =
 =93-t=94, I can provide a patch if needed).
 I=92m not very familiar with nslookup, but I recall its output differs =
 from dig=92s so I don=92t know how hard it is to replace nslookup with =
 drill (or if it is worth the effort).
 
 Cheers,
 Alex=

From: Dmitry Sivachenko <demon@FreeBSD.org>
To: bug-followup@FreeBSD.org,
 Glen Barber <gjb@FreeBSD.org>
Cc:  
Subject: Re: ports/184749: [patch] net-mgmt/nagios-plugins: Fix check_dns plugin on OSVERSION &gt;= 1000000
Date: Mon, 16 Dec 2013 16:09:55 +0400

 I committed a patch to use drill(1) instead of dig(1) in check_dig.
 For now I commented out check_dns from pkg-plist until I realize how to =
 properly install nslookup, so at least plist is not broken anymore.=

From: Glen Barber <gjb@FreeBSD.org>
To: Dmitry Sivachenko <demon@FreeBSD.org>
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/184749: [patch] net-mgmt/nagios-plugins: Fix check_dns
 plugin on OSVERSION &gt;= 1000000
Date: Mon, 16 Dec 2013 09:24:30 -0500

 --H83aLI5Lttn3Hg7B
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 On Mon, Dec 16, 2013 at 04:09:55PM +0400, Dmitry Sivachenko wrote:
 > I committed a patch to use drill(1) instead of dig(1) in check_dig.
 > For now I commented out check_dns from pkg-plist until I realize
 > how to properly install nslookup, so at least plist is not broken
 > anymore.
 
 IMHO, this is worse than the previous (broken) behavior.
 
 At least before, I could symlink /usr/local/bin/nslookup to /usr/bin
 until the next mergemaster.
 
 Now I have to disable these checks...
 
 Glen
 
 
 --H83aLI5Lttn3Hg7B
 Content-Type: application/pgp-signature
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (FreeBSD)
 
 iQIcBAEBCAAGBQJSrw0eAAoJELls3eqvi17QKSwP/17EVgiCZFJNVquaJSVOCP80
 eIhgvEZZWJL+vZPZ0bccC57prWcw9C2gQ00SvH13gycZPH9xTPoENI9NAWShQzSZ
 0kPRoXuCqmF2Ah14H8GuoxKUQnERTuaRDSQjr6irB4gkN9GRCjNazexLJiYEwGA2
 E9xcXPYNidfAuh413safcO0XloyYCgyFgouCKyZbw3RldnfisYNfAFvQLkuj2C43
 tLRVnHNAZgMujrNyx2dwRZ9t0xnlWrobJ1Tg+WMhXekK9xqbHJmFZRoB0RpjiQiC
 LO5WuBzpsZv5eel7FeNklGorLz9ukVPew0FlnOk3YUQ9YcXBqvH79lebpVA907nI
 Wy+fCd1fbn/Lyfc+F97dC59CHgv3tQ1WzAWPLUR9257+ABjISf1AFgQlu6UBcUpa
 c7Hw7zIzLyHfOPfKkEPg3ZrKpn9xsIa0Y2oYMgV2ZmJva/HyItpgIQ7TnGBe6Oy9
 w0OxProSftiK95X1MNdFNF6vLxqaVHa2jei32xqvse4JkCw9/FnoBozYqLR+1IjW
 nBVp0YwX+r0MAlkV9NsWaQ9LMsgH1llU1szGeMexqfXz+o+fGX4y1TyyTLbAX3sx
 L8qyEBoa/yDyBa489HLb1tHZD3gyEGIXBtJNkslUhyDdmIaVCR+2lxJfmMXOiDUj
 FxVDol3t9i96l8ccyLIW
 =HDB7
 -----END PGP SIGNATURE-----
 
 --H83aLI5Lttn3Hg7B--
Responsible-Changed-From-To: demon->mat 
Responsible-Changed-By: mat 
Responsible-Changed-When: Sat Apr 12 20:56:29 UTC 2014 
Responsible-Changed-Why:  
Take 

http://www.freebsd.org/cgi/query-pr.cgi?pr=184749 
State-Changed-From-To: open->closed 
State-Changed-By: mat 
State-Changed-When: Mon Apr 14 18:04:56 UTC 2014 
State-Changed-Why:  
As of r351262, nagios-plugins ships with hidden dig and nslookup binaries, 
check_dns is back, and check_dig has now the full dig options set. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=184749 
>Unformatted:
