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

Varnish varnish-bugs at varnish-cache.org
Mon Jun 21 15:26:50 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 mfournier):

 Replying to [comment:2 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.


 You are right. This specific "macro MAC_STAT" error was fixed in r4009. It
 is important to fetch the nagios plugin from the branch matching your
 varnish
 version, not from -trunk.



 > However, the plugin still doesn't build against a fresh 2.1.2 install:
 >
 > 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
 >
 >

 From what I understood, the chronology of events is as follows:

  * r509 VSL_stats->start_time got added to varnish
  * r4010 nagios/check_varnish.c adds a "-p uptime" option based on
 VSL_stats->start_time
  * r4519 adds VSL_stats->uptime
  * r4553 removes VSL_stats->start_time, which is considered obsoleted by
 VSL_stats->uptime



 > if I change the line that raises the error to
 >
 > -       up = tv.tv_sec - VSL_stats->start_time;
 > +       up = VSL_stats->uptime;
 >

 I would suggest to revert r4010 instead.

 As VSL_stats->uptime conveniently has the same name as the option added by
 r4010, "-p uptime" wouldn't get broken.



 > /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
 >
 > }}}

 This seems to have been corrected recently. Please take a look at this
 message and the next ones:

 http://lists.varnish-cache.org/pipermail/varnish-dev/2010-June/002494.html

 Workaround: edit the Makefile and change:
 {{{
 VARNISHAPI_LIBS = -lvarnishapi
 }}}
 to:
 {{{
 VARNISHAPI_LIBS = -lvarnishapi -lvarnish -lvarnishcompat
 }}}



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

 +1

 As this bugreport is in a mess, maybe you should open a new one just for
 this feature request ?

 Marc

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




More information about the varnish-bugs mailing list