From: ~/.gitconfig Date: Fri, 15 Aug 2014 18:46:02 +0000 (+0300) Subject: Fix indentation, change Prefix to EventServicePrefix X-Git-Tag: collectd-5.5.0~219^2~6 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=21dc424258a708f6e1b16e25abdd562ddd19a97a;p=collectd.git Fix indentation, change Prefix to EventServicePrefix --- diff --git a/src/collectd.conf.in b/src/collectd.conf.in index bdc4969c..52904a2d 100644 --- a/src/collectd.conf.in +++ b/src/collectd.conf.in @@ -1238,7 +1238,7 @@ # StoreRates true # AlwaysAppendDS false # TTLFactor 2.0 -# Prefix ServicePrefix +# EventServicePrefix "" # # Tag "foobar" # Attribute "foo" "bar" diff --git a/src/write_riemann.c b/src/write_riemann.c index a3b655a5..32c034c6 100644 --- a/src/write_riemann.c +++ b/src/write_riemann.c @@ -569,21 +569,20 @@ static Event *riemann_value_to_protobuf (struct riemann_host const *host, /* {{{ format_name (name_buffer, sizeof (name_buffer), /* host = */ "", vl->plugin, vl->plugin_instance, vl->type, vl->type_instance); - if (host->always_append_ds || (ds->ds_num > 1)) { - if (host->prefix == NULL) - ssnprintf (service_buffer, sizeof (service_buffer), - "%s/%s", &name_buffer[1], ds->ds[index].name); - else - ssnprintf (service_buffer, sizeof (service_buffer), - "%s/%s/%s", host->prefix, &name_buffer[1], ds->ds[index].name); - } else { - if (host->prefix == NULL) - sstrncpy (service_buffer, &name_buffer[1], - sizeof (service_buffer)); - else - ssnprintf (service_buffer, sizeof (service_buffer), - "%s/%s", host->prefix, &name_buffer[1]); - } + if (host->always_append_ds || (ds->ds_num > 1)) + if (host->prefix == NULL) + ssnprintf (service_buffer, sizeof (service_buffer), + "%s/%s", &name_buffer[1], ds->ds[index].name); + else + ssnprintf (service_buffer, sizeof (service_buffer), + "%s/%s/%s", host->prefix, &name_buffer[1], ds->ds[index].name); + else + if (host->prefix == NULL) + sstrncpy (service_buffer, &name_buffer[1], + sizeof (service_buffer)); + else + ssnprintf (service_buffer, sizeof (service_buffer), + "%s/%s", host->prefix, &name_buffer[1]); event->service = strdup (service_buffer); @@ -765,7 +764,7 @@ static int riemann_config_node(oconfig_item_t *ci) /* {{{ */ status = cf_util_get_boolean(child, &host->notifications); if (status != 0) break; - } else if (strcasecmp ("Prefix", child->key) == 0) { + } else if (strcasecmp ("EventServicePrefix", child->key) == 0) { status = cf_util_get_string (child, &host->prefix); break; } else if (strcasecmp ("CheckThresholds", child->key) == 0) {