[Nagiosplug-help] Undefined POSIX symbols in AIX 4.3 compiled nrpe binary?

Ralph.Grothe at itdz-berlin.de Ralph.Grothe at itdz-berlin.de
Wed Jan 10 14:59:10 CET 2007


Hello Nagios Users,

I need to transfer and run an nrpe binary that I had built with
gcc on an AIX 4.3 box
to an AIX 4.2 (which probably lacks any development libs and
includes).
The AIX 4.2 host where nrpe shall run lacks any development tools
I would assume.

This is the binary that's causing the pain:

$ /opt/sw/nagios/build/nrpe-2.5.2/src/nrpe -v|head -6
/opt/sw/nagios/build/nrpe-2.5.2/src/nrpe: invalid option -- v

NRPE - Nagios Remote Plugin Executor
Copyright (c) 1999-2006 Ethan Galstad (nagios at nagios.org)
Version: 2.5.1
Last Modified: 04-09-2006

$ ldd /opt/sw/nagios/build/nrpe-2.5.2/src/nrpe
/usr/lib/libc.a(pse.o)
/usr/lib/libtli.a(shr.o)
/usr/lib/libpthreads.a(shr_comm.o)
/usr/lib/libpthreads.a(shr.o)
/usr/lib/libpthreads_compat.a(shr.o)
/usr/lib/libnsl.a(shr.o)
/opt/sw/nagios/build/nrpe-2.5.2/src/nrpe
/usr/lib/libcrypt.a(shr.o)
/usr/lib/libc.a(shr.o)


On the target platform I found that libcrypt wasn't present,
why I put a copy of it from the source platform to /usr/lib on
the target platform.

When I try to execute the binary on the target platform
it complains about several undefined symbols

$ /usr/local/nagios/sbin/nrpe -h
exec(): 0509-036 Cannot load program /usr/local/nagios/sbin/nrpe
because of the following errors:

        0509-023 Symbol _posix_getpwuid_r in sh is not defined.
        0509-023 Symbol _posix_getpwnam_r in sh is not defined.
        0509-023 Symbol _posix_getgrnam_r in sh is not defined.
        0509-023 Symbol _posix_getgrgid_r in sh is not defined.
        0509-023 Symbol __nsl_init in sh is not defined.
        0509-026 System error: Cannot run a file that does not
have a valid format.

These objects indeed seem to be referred to in the binary

$ nm /opt/sw/nagios/build/nrpe-2.5.2/src/nrpe|grep -i posix
._posix_getgrgid_r   T  268448284
._posix_getgrgid_r   t  268448284      40
._posix_getgrnam_r   T  268448324
._posix_getgrnam_r   t  268448324      40
._posix_getpwnam_r   T  268448244
._posix_getpwnam_r   t  268448244      40
._posix_getpwuid_r   T  268448204
._posix_getpwuid_r   t  268448204      40
_posix_getgrgid_r    U          -
_posix_getgrgid_r    d  536877740       4
_posix_getgrnam_r    U          -
_posix_getgrnam_r    d  536877744       4
_posix_getpwnam_r    U          -
_posix_getpwnam_r    d  536877736       4
_posix_getpwuid_r    U          -
_posix_getpwuid_r    d  536877732       4
posixly_correct      d  536879044       8


Thus on the source platform I ran a find accross well known
include paths

# find /usr/include /usr/local/include -type f -name \*.h |xargs
grep -l _posix_getpwuid_
/usr/include/pwd.h

So I also transferred a copy of pwd.h which was also missing on
the target platform
to /usr/include there.
But this was probably naive since I need some object file that
contains the symbols I suppose?

And as feared, this doesn't seem to suffice as I still get above
error message from the exec() syscall
when I try to execute nrpe.

Can anyone of you give me a clue what still could be missing?
Or is my assumption of binary compatibility between AIX 4.3 and
4.2 totally unrealistic?

Unfortunately do I know nothing about AIX internals,
nor systems programming on this platform in particular.

Regards

Ralph







More information about the Help mailing list