[Varnish] #710: check_varnish.c fails to compile against varnish 2.1.x

Varnish varnish-bugs at varnish-cache.org
Tue Jun 8 13:48:43 CEST 2010


#710: check_varnish.c fails to compile against varnish 2.1.x
--------------------+-------------------------------------------------------
 Reporter:  netmax  |        Type:  defect
   Status:  new     |    Priority:  normal
Milestone:          |   Component:  nagios
  Version:  2.1.2   |    Severity:  normal
 Keywords:          |  
--------------------+-------------------------------------------------------

Comment(by sascha):

 I'm not certain, but I believe the errors above stem from trying to build
 the nagios plugin from trunk against installed libs from a 2.0.x version;
 at least the same just happened to me. However, the plugin still doesn't
 build against a fresh 2.1.2 install:


 {{{
 ~/varnish-svn-trunk/varnish-tools/nagios# make
 make  all-am
 make[1]: Entering directory `/root/varnish-svn-trunk/varnish-tools/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
 check_varnish.c: In function 'check_stats':
 check_varnish.c:176: error: 'struct varnish_stats' has no member named
 'start_time'
 make[1]: *** [check_varnish-check_varnish.o] Error 1
 make[1]: Leaving directory `/root/varnish-svn-trunk/varnish-tools/nagios'
 make: *** [all] Error 2

 }}}


 if I change the line that raises the error to


 {{{
 -       up = tv.tv_sec - VSL_stats->start_time;
 +       up = VSL_stats->uptime;

 }}}

 the error is gone, but a new one pops up:


 {{{
 ~/varnish-svn-trunk/varnish-tools/nagios# make
 make  all-am
 make[1]: Entering directory `/root/varnish-svn-trunk/varnish-tools/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/sh ./libtool --tag=CC   --mode=link gcc -include config.h
 -I/usr/include/varnish   -g -O2   -o check_varnish check_varnish-
 check_varnish.o -lvarnishapi
 gcc -include config.h -I/usr/include/varnish -g -O2 -o check_varnish
 check_varnish-check_varnish.o  /usr/lib/libvarnishapi.so
 /usr/lib/libvarnishapi.so: undefined reference to `VRE_compile'
 /usr/lib/libvarnishapi.so: undefined reference to `VRE_exec'
 collect2: ld returned 1 exit status
 make[1]: *** [check_varnish] Error 1
 make[1]: Leaving directory `/root/varnish-svn-trunk/varnish-tools/nagios'
 make: *** [all] Error 2

 }}}

 Now I'm stuck. I'm using the debian packages from "squeeze", and rebuilded
 it for lenny. At the end of the build, the following warnings showed up:


 {{{
 dpkg-shlibdeps: warning: dependency on libnsl.so.1 could be avoided if
 "debian/varnish/usr/sbin/varnishd debian/varnish/usr/bin/varnishreplay
 debian/varnish/usr/bin/varnishadm" were not uselessly linked against it
 (they use none of its symbols).
 dpkg-shlibdeps: warning: dependency on librt.so.1 could be avoided if
 "debian/varnish/usr/bin/varnishstat" were not uselessly linked against it
 (they use none of its symbols).
 dpkg-shlibdeps: warning: symbol VRE_free used by
 debian/libvarnish1/usr/lib/libvcl.so.1.0.0 found in none of the libraries.
 dpkg-shlibdeps: warning: symbol vsb_overflowed used by
 debian/libvarnish1/usr/lib/libvcl.so.1.0.0 found in none of the libraries.
 dpkg-shlibdeps: warning: symbol vsb_bcat used by
 debian/libvarnish1/usr/lib/libvcl.so.1.0.0 found in none of the libraries.
 dpkg-shlibdeps: warning: symbol vsb_printf used by
 debian/libvarnish1/usr/lib/libvcl.so.1.0.0 found in none of the libraries.
 dpkg-shlibdeps: warning: symbol vsb_delete used by
 debian/libvarnish1/usr/lib/libvcl.so.1.0.0 found in none of the libraries.
 dpkg-shlibdeps: warning: symbol VRE_compile used by
 debian/libvarnish1/usr/lib/libvcl.so.1.0.0 found in none of the libraries.
 dpkg-shlibdeps: warning: symbol vsb_vprintf used by
 debian/libvarnish1/usr/lib/libvcl.so.1.0.0 found in none of the libraries.
 dpkg-shlibdeps: warning: symbol vsb_new used by
 debian/libvarnish1/usr/lib/libvcl.so.1.0.0 found in none of the libraries.
 dpkg-shlibdeps: warning: symbol lbv_assert used by
 debian/libvarnish1/usr/lib/libvcl.so.1.0.0 found in none of the libraries.
 dpkg-shlibdeps: warning: symbol vsb_cat used by
 debian/libvarnish1/usr/lib/libvcl.so.1.0.0 found in none of the libraries.
 dpkg-shlibdeps: warning: 3 other similar warnings have been skipped (use
 -v to see them all).
 dpkg-shlibdeps: warning: symbol VRE_exec used by
 debian/libvarnish1/usr/lib/libvarnishapi.so.1.0.0 found in none of the
 libraries.
 dpkg-shlibdeps: warning: symbol VRE_compile used by
 debian/libvarnish1/usr/lib/libvarnishapi.so.1.0.0 found in none of the
 libraries.
 dpkg-shlibdeps: warning: symbol strlcpy used by
 debian/libvarnish1/usr/lib/libvarnish.so.1.0.0 found in none of the
 libraries.
 dpkg-shlibdeps: warning: dependency on libnsl.so.1 could be avoided if
 "debian/libvarnish1/usr/lib/libvarnish.so.1.0.0" were not uselessly linked
 against it (they use none of its symbols).

 }}}

 no idea if this is a flaw in the debian source package, or the varnish
 source tree itself; as far as it seems is the varnishd resulting from the
 build running just fine.

 BTW, please allow me to hijack the issue with a hint for a little
 enhancement to make the plugin output more human readable:


 {{{
 ~/varnish-svn-trunk/varnish-tools/nagios# svn diff
 Index: check_varnish.c
 ===================================================================
 --- check_varnish.c     (revision 4936)
 +++ check_varnish.c     (working copy)
 @@ -31,6 +31,7 @@
   */

  #include <inttypes.h>
 +#include <locale.h>
  #include <limits.h>
  #include <stdint.h>
  #include <stdio.h>
 @@ -200,7 +201,8 @@
                 printf("Unknown parameter '%s'\n", param);

         status = check_thresholds(value);
 -       printf("VARNISH %s: %s|%s=%jd\n", status_text[status], info,
 param, value);
 +       setlocale(LC_ALL, "");
 +       printf("VARNISH %s: %s (%'jd)|%s=%jd\n", status_text[status],
 info, value, param, value);
         exit(status);
  }

 }}}


 Would be lovely if someone has a hint about how to build the nagios plugin
 for the current varnish version.

 Cheers

 Sascha

-- 
Ticket URL: <http://varnish-cache.org/ticket/710#comment:2>
Varnish <http://varnish-cache.org/>
The Varnish HTTP Accelerator




More information about the varnish-bugs mailing list