[Nagiosplug-devel] [ nagiosplug-Bugs-1776916 ] Configure nagios-plugins inside vserver hangs

SourceForge.net noreply at sourceforge.net
Sun Dec 16 10:34:33 CET 2007


Bugs item #1776916, was opened at 2007-08-18 18:12
Message generated for change (Comment added) made by norbertklein
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1776916&group_id=29880

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Compilation
Group: Release (specify)
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: norbert (norbertklein)
Assigned to: Nobody/Anonymous (nobody)
Summary: Configure nagios-plugins inside vserver hangs

Initial Comment:
nagios-plugins-1.4.9
./configure
Gentoo
Tested on x86 AMD64
gcc

Configure nagios-plugins hangs inside vserver environment (or any other environment without IP 127.0.0.1) as soon as the configure script tries to
check the ICMP syntax.  

Reproducible: Always

Gentoo output:
checking for ps... /bin/ps
checking for ps syntax... /bin/ps axwo 'stat uid pid ppid vsz rss pcpu comm 
args'
checking for ping... /bin/ping
checking for ping6... /bin/ping6
checking for ICMP ping syntax...

ctrl-c
/usr/portage/net-analyzer/nagios-plugins/nagios-plugins-1.4.9.ebuild:
src_compile aborted; exiting.

The reason is that 127.0.0.1 is hardcoded as localhost IP inside the configure script. This is done for checking ICMP syntax and  nslookup syntax. But
vservers don't have this IP.

The following files contain 127.0.0.1 hardcoded:
configure.in
check_dig.c
check_pgsql.c
check_smtp.c
check_tcp.c
check_ups.c

I tested these five checks inside a vserver environment and check_dig was the only one which didn't work. As far as I understand the code the reason is that check_dig calls the program dig which fails in case of 127.0.0.1. The others use system calls for their operations.

To fix it I modified configure.in and used the hostname in check_dig.c. I attached a patch for the two mentioned files. For Gentoo you find a modified ebuild below which contains the patchs as well. I tested it on two different Gentoo machines and it worked for me.

http://www.acodedb.com/download/linux/nagios-plugins.tgz


----------------------------------------------------------------------

>Comment By: norbert (norbertklein)
Date: 2007-12-16 10:34

Message:
Logged In: YES 
user_id=1870307
Originator: YES

Hi Ton

unfortunately you can never be sure that "localhost" or "127.0.0.1" is
reachable in a vserver. 
The point is that in the downloadable vserver templates I have seen so
far, the file /etc/hosts always
contains the typical record "127.0.0.1 localhost". This is obvious because
the actual IP you will use for the vserver is unknown.
If you use localhost in configure.in you assume that the maintainer of the
vserver has set localhost in /etc/hosts to a valid IP.

So maybe the easiest solution is to use localhost as you have suggested
along with a warning or break off if it isn't reachable.
You could additionally add some lines which check the first IP of the
first network interface if
localhost is unavailable.
For ipv6, replacing ::1 with localhost should be the same, the standard
/etc/hosts contains an ipv6 record for localhost and configure.in
handles ipv6 with ping6.

Norbert


----------------------------------------------------------------------

Comment By: Ton Voon (tonvoon)
Date: 2007-12-13 23:28

Message:
Logged In: YES 
user_id=664364
Originator: NO

Norbert,

Thanks for the report. Would using "localhost" be okay in configure.in?
What impact would this have in IPv4 or IPv6 environments?

Ton




----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1776916&group_id=29880




More information about the Devel mailing list