sstrncpy (vl.plugin, "varnish", sizeof (vl.plugin));
if (plugin_instance == NULL)
plugin_instance = "default";
sstrncpy (vl.plugin, "varnish", sizeof (vl.plugin));
if (plugin_instance == NULL)
plugin_instance = "default";
ssnprintf (vl.plugin_instance, sizeof (vl.plugin_instance),
"%s-%s", plugin_instance, category);
ssnprintf (vl.plugin_instance, sizeof (vl.plugin_instance),
"%s-%s", plugin_instance, category);
const char *category, const char *type, const char *type_instance,
uint64_t gauge_value)
{
const char *category, const char *type, const char *type_instance,
uint64_t gauge_value)
{
- value_t value;
-
- value.gauge = (gauge_t) gauge_value;
-
- return (varnish_submit (plugin_instance, category, type, type_instance, value));
+ return (varnish_submit (plugin_instance, category, type, type_instance,
+ (value_t) { .gauge = (gauge_t) gauge_value }));
} /* }}} int varnish_submit_gauge */
static int varnish_submit_derive (const char *plugin_instance, /* {{{ */
const char *category, const char *type, const char *type_instance,
uint64_t derive_value)
{
} /* }}} int varnish_submit_gauge */
static int varnish_submit_derive (const char *plugin_instance, /* {{{ */
const char *category, const char *type, const char *type_instance,
uint64_t derive_value)
{
- value_t value;
-
- value.derive = (derive_t) derive_value;
-
- return (varnish_submit (plugin_instance, category, type, type_instance, value));
+ return (varnish_submit (plugin_instance, category, type, type_instance,
+ (value_t) { .derive = (derive_t) derive_value }));
plugin_register_complex_read (/* group = */ "varnish",
/* name = */ "varnish/localhost",
/* callback = */ varnish_read,
plugin_register_complex_read (/* group = */ "varnish",
/* name = */ "varnish/localhost",
/* callback = */ varnish_read,
cf_util_get_boolean (child, &conf->collect_connections);
else if (strcasecmp ("CollectESI", child->key) == 0)
cf_util_get_boolean (child, &conf->collect_esi);
cf_util_get_boolean (child, &conf->collect_connections);
else if (strcasecmp ("CollectESI", child->key) == 0)
cf_util_get_boolean (child, &conf->collect_esi);
#endif
else if (strcasecmp ("CollectBackend", child->key) == 0)
cf_util_get_boolean (child, &conf->collect_backend);
#endif
else if (strcasecmp ("CollectBackend", child->key) == 0)
cf_util_get_boolean (child, &conf->collect_backend);
cf_util_get_boolean (child, &conf->collect_hcb);
else if (strcasecmp ("CollectObjects", child->key) == 0)
cf_util_get_boolean (child, &conf->collect_objects);
cf_util_get_boolean (child, &conf->collect_hcb);
else if (strcasecmp ("CollectObjects", child->key) == 0)
cf_util_get_boolean (child, &conf->collect_objects);
cf_util_get_boolean (child, &conf->collect_ban);
#endif
else if (strcasecmp ("CollectSession", child->key) == 0)
cf_util_get_boolean (child, &conf->collect_ban);
#endif
else if (strcasecmp ("CollectSession", child->key) == 0)
cf_util_get_boolean (child, &conf->collect_shm);
else if (strcasecmp ("CollectSMS", child->key) == 0)
cf_util_get_boolean (child, &conf->collect_sms);
cf_util_get_boolean (child, &conf->collect_shm);
else if (strcasecmp ("CollectSMS", child->key) == 0)
cf_util_get_boolean (child, &conf->collect_sms);
#endif
else if (strcasecmp ("CollectStruct", child->key) == 0)
cf_util_get_boolean (child, &conf->collect_struct);
else if (strcasecmp ("CollectTotals", child->key) == 0)
cf_util_get_boolean (child, &conf->collect_totals);
#endif
else if (strcasecmp ("CollectStruct", child->key) == 0)
cf_util_get_boolean (child, &conf->collect_struct);
else if (strcasecmp ("CollectTotals", child->key) == 0)
cf_util_get_boolean (child, &conf->collect_totals);
#endif
else if (strcasecmp ("CollectVCL", child->key) == 0)
cf_util_get_boolean (child, &conf->collect_vcl);
else if (strcasecmp ("CollectWorkers", child->key) == 0)
cf_util_get_boolean (child, &conf->collect_workers);
#endif
else if (strcasecmp ("CollectVCL", child->key) == 0)
cf_util_get_boolean (child, &conf->collect_vcl);
else if (strcasecmp ("CollectWorkers", child->key) == 0)
cf_util_get_boolean (child, &conf->collect_workers);
WARNING ("Varnish plugin: No metric has been configured for "
"instance \"%s\". Disabling this instance.",
(conf->instance == NULL) ? "localhost" : conf->instance);
WARNING ("Varnish plugin: No metric has been configured for "
"instance \"%s\". Disabling this instance.",
(conf->instance == NULL) ? "localhost" : conf->instance);
return (EINVAL);
}
ssnprintf (callback_name, sizeof (callback_name), "varnish/%s",
(conf->instance == NULL) ? "localhost" : conf->instance);
return (EINVAL);
}
ssnprintf (callback_name, sizeof (callback_name), "varnish/%s",
(conf->instance == NULL) ? "localhost" : conf->instance);
plugin_register_complex_read (/* group = */ "varnish",
/* name = */ callback_name,
/* callback = */ varnish_read,
plugin_register_complex_read (/* group = */ "varnish",
/* name = */ callback_name,
/* callback = */ varnish_read,