Closed kowalskey closed 8 years ago
I am seeing this too
I committed a suggested fix in the https://github.com/varnish/varnish-nagios/tree/4.1-support branch. Would you @michbsd or @kowalskey mind checking it out and giving me feedback whether it works for you?
Hi, after more testing I committed the fix to master, and you should now be able to build this with varnish 4.1 too.
Hello, @denisbr
Sorry for late reply. Looks like build fails for me:
make
make all-am
make[1]: Entering directory `/root/varnish-nagios'
gcc -DHAVE_CONFIG_H -I. -include config.h -I/usr/include/varnish -g -O2 -MT check_varnish-check_varnish.o -MD -MP -MF .deps/check_varnish-check_varnish.Tpo -c -o check_varnish-check_varnish.o `test -f 'check_varnish.c' || echo './'`check_varnish.c
mv -f .deps/check_varnish-check_varnish.Tpo .deps/check_varnish-check_varnish.Po
/bin/bash ./libtool --tag=CC --mode=link gcc -include config.h -I/usr/include/varnish -g -O2 -o check_varnish check_varnish-check_varnish.o -lvarnishapi
libtool: link: gcc -include config.h -I/usr/include/varnish -g -O2 -o check_varnish check_varnish-check_varnish.o -lvarnishapi
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libvarnishapi.so: undefined reference to `pow'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libvarnishapi.so: undefined reference to `round'
collect2: error: ld returned 1 exit status
make[1]: *** [check_varnish] Error 1
make[1]: Leaving directory `/root/varnish-nagios'
make: *** [all] Error 2
Here's full build log: https://gist.github.com/kowalskey/9573984cdef24a435133
Changing
gcc -include config.h -I/usr/include/varnish -g -O2 -o check_varnish check_varnish-check_varnish.o -lvarnishapi
to
gcc -include config.h -I/usr/include/varnish -g -O2 -o check_varnish check_varnish-check_varnish.o -lvarnishapi -lm
(note -lm
at the end)
fixes gcc command and produces valid check_varnish executable
I also managed to fix it by adding
AC_SEARCH_LIBS([pow],[m],[],[AC_MSG_ERROR([unable to find libm])])
to configure.ac
so autogen.sh will generate ./configure
script which will look for libm
.
@kowalskey Thanks for the report, this is a totally different issue though, so I'll create a new issue for it, and use your suggested patch to fix it.
@denisbr thank you!
I was able to successfully build varnish-nagios
from master.
Compiled check also seems to work and correctly validate things like uptime or hit ratio.
Hello! Looks like
varnish-nagios
doesn't compile withlibvarnishapi-dev
for Varnish 4.1Here's log from my shell: https://gist.github.com/kowalskey/bd9b57be85725a8bf4e3
I tried to build
varnish-nagios
under Ubuntu 14.04.3 LTS, with latest libvarnishapi-dev available (4.1.0-1~trusty)First error seems to be: