format_graphite: Implement the "separate instances" and "always append ds" options.
[collectd.git] / src / varnish.c
index d0e6a80..de60e39 100644 (file)
@@ -216,7 +216,7 @@ static int varnish_submit_derive (const char *plugin_instance, /* {{{ */
 } /* }}} int varnish_submit_derive */
 
 static void varnish_monitor (const user_config_t *conf, /* {{{ */
-               c_varnish_stats_t *stats)
+               const c_varnish_stats_t *stats)
 {
        if (conf->collect_cache)
        {
@@ -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.");