Added the instance name to varnish API
authorJonathan Huot <jonathan.huot@gmail.com>
Thu, 2 Aug 2012 15:56:05 +0000 (18:56 +0300)
committerFlorian Forster <octo@collectd.org>
Sun, 26 Aug 2012 05:56:40 +0000 (07:56 +0200)
Fixed issue collectd#110

Signed-off-by: Florian Forster <octo@collectd.org>
src/varnish.c

index 357b5f1..de60e39 100644 (file)
@@ -412,6 +412,11 @@ static int varnish_read (user_data_t *ud) /* {{{ */
 
        vd = VSM_New();
        VSC_Setup(vd);
+       if (VSM_n_Arg(vd, conf->instance) == -1)
+       {
+               ERROR ("Varnish plugin : unable to load statistics from instance");
+               return (-1);
+       }
        if (VSC_Open (vd, /* diag = */ 1))
        {
                ERROR ("varnish plugin: Unable to load statistics.");