]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
Revert "VSM only apply for Varnish 4"
authorMatthias Runge <mrunge@redhat.com>
Fri, 13 Mar 2020 14:13:22 +0000 (15:13 +0100)
committerMatthias Runge <mrunge@redhat.com>
Fri, 13 Mar 2020 14:13:22 +0000 (15:13 +0100)
This reverts commit f53b448d7935bf823e0594d75cac0c0a16e8172b.

src/varnish.c

index 5e26ef209d7874ce38dd58572e65cf5169040fc8..49b886f3ae1ce44df8cff6b71d5b056502fd313b 100644 (file)
@@ -54,9 +54,7 @@ struct user_config_s {
   bool collect_uptime;
   bool collect_vcl;
   bool collect_workers;
-#if HAVE_VARNISH_V4
   bool collect_vsm;
-#endif
   bool collect_lck;
   bool collect_mempool;
   bool collect_mgt;
@@ -662,7 +660,6 @@ static int varnish_monitor(void *priv,
                                    "busy_killed", val);
   }
 
-#if HAVE_VARNISH_V4
   if (conf->collect_vsm) {
     if (strcmp(name, "vsm_free") == 0)
       return varnish_submit_gauge(conf->instance, "vsm", "bytes", "free", val);
@@ -678,7 +675,6 @@ static int varnish_monitor(void *priv,
       return varnish_submit_derive(conf->instance, "vsm", "total_bytes",
                                    "overflowed", val);
   }
-#endif
 
   if (conf->collect_vbe) {
     /* @TODO figure out the collectd type for bitmap
@@ -1069,9 +1065,7 @@ static int varnish_config_apply_default(user_config_t *conf) /* {{{ */
   conf->collect_uptime = false;
   conf->collect_vcl = false;
   conf->collect_workers = false;
-#if HAVE_VARNISH_V4
   conf->collect_vsm = false;
-#endif
   conf->collect_lck = false;
   conf->collect_mempool = false;
   conf->collect_mgt = false;
@@ -1182,12 +1176,7 @@ static int varnish_config_instance(const oconfig_item_t *ci) /* {{{ */
     else if (strcasecmp("CollectWorkers", child->key) == 0)
       cf_util_get_boolean(child, &conf->collect_workers);
     else if (strcasecmp("CollectVSM", child->key) == 0)
-#if HAVE_VARNISH_V4
       cf_util_get_boolean(child, &conf->collect_vsm);
-#else
-      WARNING("Varnish plugin: \"%s\" is available for Varnish %s only.",
-              child->key, "v4");
-#endif
     else if (strcasecmp("CollectLock", child->key) == 0)
       cf_util_get_boolean(child, &conf->collect_lck);
     else if (strcasecmp("CollectMempool", child->key) == 0)
@@ -1220,10 +1209,7 @@ static int varnish_config_instance(const oconfig_item_t *ci) /* {{{ */
       && !conf->collect_struct && !conf->collect_totals
       && !conf->collect_uptime
       && !conf->collect_vcl && !conf->collect_workers
-#if HAVE_VARNISH_V4
-      && !conf->collect_vsm 
-#endif
-      && !conf->collect_vbe && !conf->collect_smf &&
+      && !conf->collect_vsm && !conf->collect_vbe && !conf->collect_smf &&
       !conf->collect_mgt && !conf->collect_lck && !conf->collect_mempool &&
       !conf->collect_mse
   ) {