ports/133069: [patch] net-mgmt/nagios-plugins doesn't configure properly in jail

L Campbell llc2w at virginia.edu
Wed Mar 25 18:40:03 UTC 2009


>Number:         133069
>Category:       ports
>Synopsis:       [patch] net-mgmt/nagios-plugins doesn't configure properly in jail
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Wed Mar 25 18:40:01 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     L Campbell
>Release:        7.1
>Organization:
>Environment:
FreeBSD souseiseki.desudesudesu.org 7.1-RELEASE FreeBSD 7.1-RELEASE #0: Thu Jan  1 14:37:25 UTC 2009     root at logan.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386
>Description:
I'm running Nagios in a jail and ran into the issue described in this
thread from December --

http://www.mail-archive.com/freebsd-jail@freebsd.org/msg00638.html

The gist of it is that the Nagios plugin configure script goes through
an exhaustive list of ping command options looking for one that works.
The problem is they're testing each style by pinging the localhost,
127.0.0.1. In a jailed environment, that IP address may or may not be
visible:

root at jail-nagios> ping -n -c 1 127.0.0.1
PING 127.0.0.1 (127.0.0.1): 56 data bytes
ping: sendto: Can't assign requested address

This causes their configure script to not be able to find the ping
command. This failure causes PING_COMMAND to be defined as "" (which
is a case their code doesn't check for) and smashes the stack whenever
you try to run the binary.

With the attached patch applied, the check_ping binary works as expected when
built from within a jail (rather than emitting "not enough args" and
segfaulting):

root at jail-nagios> ./check_ping 10.0.0.5 -w 3000.0,80% -c 5000.0,100%
PING OK - Packet loss = 0%, RTA = 0.03
ms|rta=0.028000ms;3000.000000;5000.000000;0.000000 pl=0%;80;100;0
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

--- Makefile.orig       2009-02-26 12:04:16.000000000 +0000
+++ Makefile    2009-02-26 12:24:36.000000000 +0000
@@ -38,6 +38,8 @@
 NAGIOSWWWDIR?= www/nagios
 NAGIOSHTMURL?= /nagios
 NAGIOSCGIURL?= ${NAGIOSHTMURL}/cgi-bin
+NAGIOSPINGCMD?= '/sbin/ping -n -s 56 -t %d -c %d %s'
+NAGIOSPING6CMD?= '/sbin/ping6 -n -s 56 -t %d -c %d %s'

 .include <bsd.port.pre.mk>

@@ -49,7 +51,9 @@
               --datadir=${PREFIX}/share \
               --sysconfdir=${PREFIX}/etc/nagios \
               --localstatedir=${NAGIOSDIR} \
-               --prefix=${PREFIX}
+               --prefix=${PREFIX} \
+               --with-ping-command=${NAGIOSPINGCMD} \
+               --with-ping6-command=${NAGIOSPING6CMD}

 CONFIGURE_ENV= CPPFLAGS="${CPPFLAGS} -I${LOCALBASE}/include" \
               CFLAGS="${CFLAGS} -I${LOCALBASE}/include" \

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list