Page 1 of 2

Upgrade Nagios to 4.4.0 compiling problem workers.c

Posted: Thu Jun 21, 2018 8:14 am
by Peli
Hello

I am not able to upgrade my nagios core installation from 4.3.4 to 4.4.0.

Code: Select all

nagios@nagios-test:/tmp/nagios-4.4.0$ make all
cd ./base && make
make[1]: Entering directory '/tmp/nagios-4.4.0/base'
gcc -Wall -I.. -g -O2 -DHAVE_CONFIG_H -DNSCORE -c -o nagios.o nagios.c
gcc -Wall -I.. -g -O2 -DHAVE_CONFIG_H -DNSCORE   -c -o broker.o broker.c
gcc -Wall -I.. -g -O2 -DHAVE_CONFIG_H -DNSCORE   -c -o nebmods.o nebmods.c
gcc -Wall -I.. -g -O2 -DHAVE_CONFIG_H -DNSCORE -c -o ../common/shared.o ../common/shared.c
gcc -Wall -I.. -g -O2 -DHAVE_CONFIG_H -DNSCORE   -c -o query-handler.o query-handler.c
gcc -Wall -I.. -g -O2 -DHAVE_CONFIG_H -DNSCORE -c -o workers.o workers.c
workers.c: In function ‘wproc_run_job’:
workers.c:1173:106: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘ssize_t {aka int}’ [-Wformat=]
   logit(NSLOG_RUNTIME_ERROR, TRUE, "wproc: '%s' seems to be choked. ret = %d; bufsize = %lu: written = %lu; errno = %d (%s)\n",
                                                                                                          ^
gcc -Wall -I.. -g -O2 -DHAVE_CONFIG_H -DNSCORE   -c -o checks.o checks.c
gcc -Wall -I.. -g -O2 -DHAVE_CONFIG_H -DNSCORE   -c -o config.o config.c
gcc -Wall -I.. -g -O2 -DHAVE_CONFIG_H -DNSCORE   -c -o commands.o commands.c
gcc -Wall -I.. -g -O2 -DHAVE_CONFIG_H -DNSCORE   -c -o events.o events.c
Linux Debian is on latest build 9.4

Any ideas? Thank you for helping.
Christian

Re: Upgrade Nagios to 4.4.0 compiling problem workers.c

Posted: Thu Jun 21, 2018 10:44 am
by scottwilkerson
Did you run ./configure ?
Did you pass any additional flags to ./configure?

Re: Upgrade Nagios to 4.4.0 compiling problem workers.c

Posted: Fri Jun 22, 2018 10:50 am
by Peli
scottwilkerson wrote:Did you run ./configure ?
Did you pass any additional flags to ./configure?
Yes, i run

Code: Select all

./configure --with-command-group=nagcmd
This worked for every upgrade yet.

Kind regards
Christian

Re: Upgrade Nagios to 4.4.0 compiling problem workers.c

Posted: Mon Jun 25, 2018 7:17 am
by scottwilkerson
We have tried but cannot replicate this issue, at this point I would suggest re-downloading the tar from
https://www.nagios.org/downloads/nagios-core/

and try again

Re: Upgrade Nagios to 4.4.0 compiling problem workers.c

Posted: Mon Jun 25, 2018 8:32 am
by Peli
I have re-downloaded the source. But when compiling, i had the same error.

Re: Upgrade Nagios to 4.4.0 compiling problem workers.c

Posted: Mon Jun 25, 2018 9:45 am
by scottwilkerson
Peli,

Talking with our C developer about the issue, we are both baffled, but he was wondering if it was possible for you to download our maint branch and try with that

https://github.com/NagiosEnterprises/na ... tree/maint

Re: Upgrade Nagios to 4.4.0 compiling problem workers.c

Posted: Mon Jun 25, 2018 11:58 am
by bheden
Peli,

Before attempting to install the 4.4.1 branch, can you run the following command (from the directory you run make all from) and try to recompile?

Code: Select all

sed -i 's/written, errno/(long unsigned int)written, errno/' base/workers.c

Re: Upgrade Nagios to 4.4.0 compiling problem workers.c

Posted: Tue Jun 26, 2018 1:18 am
by Peli
bheden wrote:Peli,

Before attempting to install the 4.4.1 branch, can you run the following command (from the directory you run make all from) and try to recompile?

Code: Select all

sed -i 's/written, errno/(long unsigned int)written, errno/' base/workers.c
Thank you for helping. This worked. After this command, compiling passed without error.

Re: Upgrade Nagios to 4.4.0 compiling problem workers.c

Posted: Tue Jun 26, 2018 6:22 am
by scottwilkerson
Excellent glad we could provide a fix.

Re: Upgrade Nagios to 4.4.0 compiling problem workers.c

Posted: Tue Jun 26, 2018 9:35 am
by bheden
4.4.1 was released yesterday - I would recommend upgrading to that version.