Bug 133069 - [patch] net-mgmt/nagios-plugins doesn't configure properly in jail
Summary: [patch] net-mgmt/nagios-plugins doesn't configure properly in jail
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Wesley Shields
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-25 18:40 UTC by L Campbell
Modified: 2009-04-09 01:00 UTC (History)
0 users

See Also:


Attachments
file.diff (824 bytes, patch)
2009-03-25 18:40 UTC, L Campbell
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description L Campbell 2009-03-25 18:40:01 UTC
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@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@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

Fix: Patch attached with submission follows:
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2009-03-25 18:40:12 UTC
Maintainer of net-mgmt/nagios-plugins,

Please note that PR ports/133069 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/133069

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2009-03-25 18:40:16 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 3 Jarrod Sayers 2009-03-31 10:41:33 UTC
Thanks for the friendly reminder.  I have a cleaner patch that's a  
little more user friendly and still allows the configure script to  
detect things by itself.  I'll send it to you offline tomorrow morning  
and if you're happy with it then I can have that committed.

Jarrod.
Comment 4 Mark Linimon freebsd_committer freebsd_triage 2009-03-31 13:37:19 UTC
State Changed
From-To: feedback->suspended

Maintainer is working on a different patch.
Comment 5 Wesley Shields freebsd_committer freebsd_triage 2009-03-31 14:46:20 UTC
Responsible Changed
From-To: freebsd-ports-bugs->wxs

I'll take it.
Comment 6 Wesley Shields freebsd_committer freebsd_triage 2009-04-07 21:40:59 UTC
Jarrod,

Any word yet on your patch for this?

-- WXS
Comment 7 Jarrod Sayers 2009-04-08 13:06:50 UTC
Submitter (sorry, not sure of your first name), can you please try the  
following patch and advise if this resolves your issue?  With the JAIL  
option enabled, you can then override the IP used by the configure  
script by defining a NAGIOSPOLLIP in /etc/make.conf.

http://www.netleader.com.au/~jarrod/FreeBSD/net-mgmt-nagios-plugins-WITH_JAIL.diff

Jarrod.
Comment 8 L Campbell 2009-04-08 14:15:43 UTC
On Wed, Apr 8, 2009 at 8:06 AM, Jarrod Sayers <jarrod@netleader.com.au> wro=
te:
> Submitter (sorry, not sure of your first name), can you please try the
> following patch and advise if this resolves your issue? =C2=A0With the JA=
IL
> option enabled, you can then override the IP used by the configure script=
 by
> defining a NAGIOSPOLLIP in /etc/make.conf.
>
> http://www.netleader.com.au/~jarrod/FreeBSD/net-mgmt-nagios-plugins-WITH_=
JAIL.diff
>
> Jarrod.
>

Patch works fine for me. I kind of wish the OPTIONS infrastructure
could be used instead of make.conf, but that's neither here nor there.

Thanks a bunch :3
Comment 9 Wesley Shields freebsd_committer freebsd_triage 2009-04-09 00:25:18 UTC
On Wed, Apr 08, 2009 at 09:15:43AM -0400, L Campbell wrote:
> On Wed, Apr 8, 2009 at 8:06 AM, Jarrod Sayers <jarrod@netleader.com.au> wrote:
> > Submitter (sorry, not sure of your first name), can you please try the
> > following patch and advise if this resolves your issue? ??With the JAIL
> > option enabled, you can then override the IP used by the configure script by
> > defining a NAGIOSPOLLIP in /etc/make.conf.
> >
> > http://www.netleader.com.au/~jarrod/FreeBSD/net-mgmt-nagios-plugins-WITH_JAIL.diff
> >
> > Jarrod.
> >
> 
> Patch works fine for me. I kind of wish the OPTIONS infrastructure
> could be used instead of make.conf, but that's neither here nor there.
> 
> Thanks a bunch :3

Thanks for testing this!

Jarrod: I assume this is the patch you would like me to commit?  If
possible I'd like to get it in before the freeze, which is supposed to
be less than a week from now.

-- WXS
Comment 10 Jarrod Sayers 2009-04-09 00:43:23 UTC
On Wed, 8 Apr 2009, Wesley Shields wrote:
> Jarrod: I assume this is the patch you would like me to commit?  If 
> possible I'd like to get it in before the freeze, which is supposed to 
> be less than a week from now.

Go for it.

Jarrod.
Comment 11 dfilter service freebsd_committer freebsd_triage 2009-04-09 00:53:32 UTC
wxs         2009-04-08 23:53:22 UTC

  FreeBSD ports repository

  Modified files:
    net-mgmt/nagios-plugins Makefile 
  Log:
  - Add option for building in a jail (default OFF).  With this option set
    the IP address that is used for polling is replaced with whatever is
    defined in ${NAGIOSPOLLIP} (default is 127.0.0.1).  If you want to
    change this please set it in ports.conf.
  
  PR:             ports/133069
  Submitted by:   L Campbell <llc2w@virginia.edu>
  Approved by:    Jarrod Sayers <jarrod@netleader.com.au> (maintainer)
  
  Revision  Changes    Path
  1.73      +7 -1      ports/net-mgmt/nagios-plugins/Makefile
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 12 Wesley Shields freebsd_committer freebsd_triage 2009-04-09 00:53:41 UTC
State Changed
From-To: suspended->closed

Committed. Thanks!