Compiling nrpe for AIX 7.1

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
chands
Posts: 12
Joined: Tue Nov 08, 2016 2:27 pm

Compiling nrpe for AIX 7.1

Post by chands »

Hello there

For AIX Version 7.1

Has anyone had success to compile the latest version of nrpe for AIX 7.1
I am having problems/errors

1. # ./configure --configure --enable-command-args
Goes thorough the motions and all looks good.
The problem is when I running "make all"
I get this:
*** Configuration summary for nrpe 3.1.1 2017-05-24 ***:

General Options:
-------------------------
NRPE port: 5666
NRPE user: nagios
NRPE group: nagios
Nagios user: nagios
Nagios group: nagios


Review the options above for accuracy. If they look okay,
type 'make all' to compile the NRPE daemon and client
or type 'make' to get a list of make options.

zzzzzzzzz:/export/stage/nagios/src/nrpe/nrpe-master# make all
cd ./src/; make
gcc -g -O2 -I/usr/include/openssl -DHAVE_CONFIG_H -I ../include -I ./../include -c ./snprintf.c
gcc -g -O2 -I/usr/include/openssl -DHAVE_CONFIG_H -I ../include -I ./../include -o nrpe ./nrpe.c ./utils.c ./acl.c -L/usr/lib -lssl -lcrypto -lnsl ./snprintf.o
./nrpe.c: In function 'init_ssl':
./nrpe.c:267: warning: assignment discards qualifiers from pointer target type
./nrpe.c:296: warning: assignment discards qualifiers from pointer target type
./nrpe.c:300: warning: assignment discards qualifiers from pointer target type
./nrpe.c:303: warning: assignment discards qualifiers from pointer target type
./nrpe.c:306: warning: assignment discards qualifiers from pointer target type
./nrpe.c:309: warning: assignment discards qualifiers from pointer target type
./nrpe.c: In function 'run_inetd':
./nrpe.c:569: error: 'O_WRONLY' undeclared (first use in this function)
./nrpe.c:569: error: (Each undeclared identifier is reported only once
./nrpe.c:569: error: for each function it appears in.)
./nrpe.c: In function 'set_stdio_sigs':
./nrpe.c:627: error: 'O_RDONLY' undeclared (first use in this function)
./nrpe.c:628: error: 'O_WRONLY' undeclared (first use in this function)
./nrpe.c: In function 'create_listener':
./nrpe.c:1194: error: 'F_SETFL' undeclared (first use in this function)
./nrpe.c:1194: error: 'O_NONBLOCK' undeclared (first use in this function)
./nrpe.c: In function 'handle_conn_ssl':
./nrpe.c:1914: warning: assignment discards qualifiers from pointer target type
./nrpe.c: In function 'my_system':
./nrpe.c:2135: error: 'F_SETFL' undeclared (first use in this function)
./nrpe.c:2135: error: 'O_NONBLOCK' undeclared (first use in this function)
./nrpe.c: In function 'write_pid_file':
./nrpe.c:2379: error: 'O_RDONLY' undeclared (first use in this function)
./nrpe.c:2403: error: 'O_WRONLY' undeclared (first use in this function)
./nrpe.c:2403: error: 'O_CREAT' undeclared (first use in this function)
./utils.c: In function 'open_log_file':
./utils.c:473: error: 'O_RDWR' undeclared (first use in this function)
./utils.c:473: error: (Each undeclared identifier is reported only once
./utils.c:473: error: for each function it appears in.)
./utils.c:473: error: 'O_APPEND' undeclared (first use in this function)
./utils.c:473: error: 'O_CREAT' undeclared (first use in this function)
./utils.c:511: error: 'F_SETFD' undeclared (first use in this function)
./utils.c:511: error: 'FD_CLOEXEC' undeclared (first use in this function)
make: 1254-004 The error code from the last command is 1.

Stop.
make: 1254-004 The error code from the last command is 2.

Stop.
szzzzzzz:/export/stage/nagios/src/nrpe/nrpe-master#
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: Compiling nrpe for AIX 7.1

Post by avandemore »

I'm pretty sure that you didn't use that ./configure --configure since that isn't a valid argument.

Code: Select all

[root@core nrpe-master]# ./configure --configure --enable-command-args
configure: error: unrecognized option: `--configure'
Try `./configure --help' for more information
It would be more helpful if you showed exactly what you passed to the configure script or your resulting Makefile. The rest of your error is related to ssl. Are you sure you have the correct SSL parts needed?
Previous Nagios employee
chands
Posts: 12
Joined: Tue Nov 08, 2016 2:27 pm

Re: Compiling nrpe for AIX 7.1

Post by chands »

Without SSL I am getting these errors:

/export/stage/nagios/src/nrpe/nrpe-master# ./configure --enable-command-args --disable-ssl
checking for a BSD-compatible install... build-aux/install-sh -c
checking what the operating system is ... aix
checking what the distribution type is ... aix
checking what init system is being used ... bsd
checking what inetd is being used ... inetd
checking for which paths to use ... default
checking for which init file to use ... bsd-init
checking for which inetd files to use ... default-inetd
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether make sets $(MAKE)... yes
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking whether time.h and sys/time.h may both be included... yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... no
checking ctype.h usability... yes
checking ctype.h presence... yes
checking for ctype.h... yes
checking dirent.h usability... yes
checking dirent.h presence... yes
checking for dirent.h... yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking fcntl.h usability... no
checking fcntl.h presence... yes
configure: WARNING: fcntl.h: present but cannot be compiled
configure: WARNING: fcntl.h: check for missing prerequisite headers?
configure: WARNING: fcntl.h: see the Autoconf documentation
configure: WARNING: fcntl.h: section "Present But Cannot Be Compiled"
configure: WARNING: fcntl.h: proceeding with the compiler's result
configure: WARNING: ## ------------------------------------------------- ##
configure: WARNING: ## Report this to [email protected] ##
configure: WARNING: ## ------------------------------------------------- ##
checking for fcntl.h... no
checking getopt.h usability... no
checking getopt.h presence... no
checking for getopt.h... no
checking grp.h usability... yes
checking grp.h presence... yes
checking for grp.h... yes
checking for inttypes.h... (cached) yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking pwd.h usability... yes
checking pwd.h presence... yes
checking for pwd.h... yes
checking signal.h usability... yes
checking signal.h presence... yes
checking for signal.h... yes
checking for stdint.h... (cached) yes
checking for strings.h... (cached) yes
checking for string.h... (cached) yes
checking syslog.h usability... yes
checking syslog.h presence... yes
checking for syslog.h... yes
checking tcpd.h usability... no
checking tcpd.h presence... no
checking for tcpd.h... no
checking for unistd.h... (cached) no
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking socket.h usability... no
checking socket.h presence... no
checking for socket.h... no
checking for sys/types.h... (cached) yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking sys/resource.h usability... yes
checking sys/resource.h presence... yes
checking for sys/resource.h... yes
checking for sys/wait.h... (cached) yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking for sys/stat.h... (cached) yes
checking paths.h usability... yes
checking paths.h presence... yes
checking for paths.h... yes
checking for an ANSI C-conforming const... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking for mode_t... yes
checking for pid_t... yes
checking for size_t... yes
checking return type of signal handlers... void
checking for uid_t in sys/types.h... yes
checking type of array argument to getgroups... gid_t
checking size of int... 4
checking size of short... 2
checking size of long... 4
checking for uint32_t... yes
checking for u_int32_t... yes
checking for int32_t... yes
checking for struct sockaddr_storage... yes
checking for seteuid... yes
checking for va_copy... yes
checking for vsnprintf... yes
checking for snprintf... yes
checking for asprintf... no
checking for vasprintf... no
checking for C99 vsnprintf... yes
checking for getopt_long... no
checking for getopt_long in -liberty... no
checking for main in -lnsl... yes
checking for socket in -lsocket... no
checking for main in -lwrap... no
checking for strdup... yes
checking for strstr... yes
checking for strtoul... yes
checking for strtok_r... yes
checking for initgroups... yes
checking for closesocket... no
checking for sigaction... yes
checking for scandir... yes
checking for socklen_t... yes
checking for type of socket size... size_t
checking for perl... /usr/bin/perl
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating nrpe.spec
config.status: creating uninstall
config.status: creating sample-config/nrpe.cfg
config.status: creating startup/bsd-init
config.status: creating startup/debian-init
config.status: creating startup/default-init
config.status: creating startup/default-inetd
config.status: creating startup/default-service
config.status: creating startup/default-socket
config.status: creating startup/default-socket-svc
config.status: creating startup/default-xinetd
config.status: creating startup/mac-init.plist
config.status: creating startup/mac-inetd.plist
config.status: creating startup/newbsd-init
config.status: creating startup/openbsd-init
config.status: creating startup/openrc-conf
config.status: creating startup/openrc-init
config.status: creating startup/solaris-init.xml
config.status: creating startup/solaris-inetd.xml
config.status: creating startup/tmpfile.conf
config.status: creating startup/upstart-init
config.status: creating startup/rh-upstart-init
config.status: creating include/common.h
config.status: creating include/config.h
config.status: include/config.h is unchanged


*** Configuration summary for nrpe 3.1.1 2017-05-24 ***:

General Options:
-------------------------
NRPE port: 5666
NRPE user: nagios
NRPE group: nagios
Nagios user: nagios
Nagios group: nagios


Review the options above for accuracy. If they look okay,
type 'make all' to compile the NRPE daemon and client
or type 'make' to get a list of make options.

sranimpr02:/export/stage/nagios/src/nrpe/nrpe-master# make

Please enter make [option] where [option] is one of:

all builds nrpe and check_nrpe
nrpe builds nrpe only
check_nrpe builds check_nrpe only
install-groups-users add the users and groups if they do not exist
install install nrpe and check_nrpe
install-plugin install the check_nrpe plugin
install-daemon install the nrpe daemon
install-config install the nrpe configuration file
install-inetd install the startup files for inetd, launchd, etc.
install-init install the startup files for init, systemd, etc.

sranimpr02:/export/stage/nagios/src/nrpe/nrpe-master# make all
cd ./src/; make
gcc -g -O2 -DHAVE_CONFIG_H -I ../include -I ./../include -c ./snprintf.c
gcc -g -O2 -DHAVE_CONFIG_H -I ../include -I ./../include -o nrpe ./nrpe.c ./utils.c ./acl.c -lnsl ./snprintf.o
In file included from /usr/include/fcntl.h:219,
from ./nrpe.c:32:
/usr/include/unistd.h:1061: error: expected ')' before '[' token
/usr/include/unistd.h:1062: error: expected declaration specifiers or '...' before 'rid_t'
./utils.c: In function 'open_log_file':
./utils.c:473: error: 'O_RDWR' undeclared (first use in this function)
./utils.c:473: error: (Each undeclared identifier is reported only once
./utils.c:473: error: for each function it appears in.)
./utils.c:473: error: 'O_APPEND' undeclared (first use in this function)
./utils.c:473: error: 'O_CREAT' undeclared (first use in this function)
./utils.c:511: error: 'F_SETFD' undeclared (first use in this function)
./utils.c:511: error: 'FD_CLOEXEC' undeclared (first use in this function)
make: 1254-004 The error code from the last command is 1.


Stop.
make: 1254-004 The error code from the last command is 2.


Stop.
chands
Posts: 12
Joined: Tue Nov 08, 2016 2:27 pm

Re: Compiling nrpe for AIX 7.1

Post by chands »

Found the problem.
It was related to AIX 7.1 and GCC

All looking good now.

Cheers
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Compiling nrpe for AIX 7.1

Post by cdienger »

Hi Chands,

Glad to hear you were able to resolve it! Can you provide some details on what the problem/solution was in case others run into the same situation?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked