X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Famqp.c;h=edd4f749396bbb14c501792b62db70d188ade0de;hb=a1e1d77f21f3568f6392d5bba5c1dfec187c728b;hp=9c8c6e537c6cb1d2f3907402f7c602e2f8b326b6;hpb=3faf514fd9b869cadda0f895e14e5036313c7781;p=collectd.git diff --git a/src/amqp.c b/src/amqp.c index 9c8c6e53..edd4f749 100644 --- a/src/amqp.c +++ b/src/amqp.c @@ -74,6 +74,7 @@ struct camqp_config_s char *prefix; char *postfix; char escape_char; + unsigned int graphite_flags; /* subscribe only */ char *exchange_type; @@ -794,7 +795,7 @@ static int camqp_write (const data_set_t *ds, const value_list_t *vl, /* {{{ */ { status = format_graphite (buffer, sizeof (buffer), ds, vl, conf->prefix, conf->postfix, conf->escape_char, - conf->store_rates); + conf->graphite_flags); if (status != 0) { ERROR ("amqp plugin: format_graphite failed with status %i.", @@ -876,6 +877,7 @@ static int camqp_config_connection (oconfig_item_t *ci, /* {{{ */ /* publish only */ conf->delivery_mode = CAMQP_DM_VOLATILE; conf->store_rates = 0; + conf->graphite_flags = 0; /* publish & graphite only */ conf->prefix = NULL; conf->postfix = NULL; @@ -934,9 +936,19 @@ static int camqp_config_connection (oconfig_item_t *ci, /* {{{ */ conf->delivery_mode = CAMQP_DM_VOLATILE; } else if ((strcasecmp ("StoreRates", child->key) == 0) && publish) + { status = cf_util_get_boolean (child, &conf->store_rates); + (void) cf_util_get_flag (child, &conf->graphite_flags, + GRAPHITE_STORE_RATES); + } else if ((strcasecmp ("Format", child->key) == 0) && publish) status = camqp_config_set_format (child, conf); + else if ((strcasecmp ("GraphiteSeparateInstances", child->key) == 0) && publish) + status = cf_util_get_flag (child, &conf->graphite_flags, + GRAPHITE_SEPARATE_INSTANCES); + else if ((strcasecmp ("GraphiteAlwaysAppendDS", child->key) == 0) && publish) + status = cf_util_get_flag (child, &conf->graphite_flags, + GRAPHITE_ALWAYS_APPEND_DS); else if ((strcasecmp ("GraphitePrefix", child->key) == 0) && publish) status = cf_util_get_string (child, &conf->prefix); else if ((strcasecmp ("GraphitePostfix", child->key) == 0) && publish)