2 * collectd - src/write_riemann.c
3 * Copyright (C) 2012,2013 Pierre-Yves Ritschard
4 * Copyright (C) 2013 Florian octo Forster
5 * Copyright (C) 2015,2016 Gergely Nagy
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included in
15 * all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23 * DEALINGS IN THE SOFTWARE.
26 * Pierre-Yves Ritschard <pyr at spootnik.org>
27 * Florian octo Forster <octo at collectd.org>
28 * Gergely Nagy <algernon at madhouse-project.org>
34 #include "configfile.h"
36 #include "utils_cache.h"
37 #include "utils_complain.h"
38 #include "write_riemann_threshold.h"
41 #include <riemann/riemann-client.h>
43 #define RIEMANN_HOST "localhost"
44 #define RIEMANN_PORT 5555
45 #define RIEMANN_TTL_FACTOR 2.0
46 #define RIEMANN_BATCH_MAX 8192
49 c_complain_t init_complaint;
51 char *event_service_prefix;
55 _Bool check_thresholds;
57 _Bool always_append_ds;
60 riemann_client_type_t client_type;
61 riemann_client_t *client;
67 riemann_message_t *batch_msg;
71 struct timeval timeout;
74 static char **riemann_tags;
75 static size_t riemann_tags_num;
76 static char **riemann_attrs;
77 static size_t riemann_attrs_num;
79 /* host->lock must be held when calling this function. */
80 static int wrr_connect(struct riemann_host *host) /* {{{ */
88 node = (host->node != NULL) ? host->node : RIEMANN_HOST;
89 port = (host->port) ? host->port : RIEMANN_PORT;
93 host->client = riemann_client_create(
94 host->client_type, node, port, RIEMANN_CLIENT_OPTION_TLS_CA_FILE,
95 host->tls_ca_file, RIEMANN_CLIENT_OPTION_TLS_CERT_FILE,
96 host->tls_cert_file, RIEMANN_CLIENT_OPTION_TLS_KEY_FILE,
97 host->tls_key_file, RIEMANN_CLIENT_OPTION_NONE);
98 if (host->client == NULL) {
99 c_complain(LOG_ERR, &host->init_complaint,
100 "write_riemann plugin: Unable to connect to Riemann at %s:%d",
104 if (host->timeout.tv_sec != 0) {
105 if (riemann_client_set_timeout(host->client, &host->timeout) != 0) {
106 riemann_client_free(host->client);
108 c_complain(LOG_ERR, &host->init_complaint,
109 "write_riemann plugin: Unable to connect to Riemann at %s:%d",
115 c_release(LOG_INFO, &host->init_complaint,
116 "write_riemann plugin: Successfully connected to %s:%d", node,
120 } /* }}} int wrr_connect */
122 /* host->lock must be held when calling this function. */
123 static int wrr_disconnect(struct riemann_host *host) /* {{{ */
128 riemann_client_free(host->client);
132 } /* }}} int wrr_disconnect */
135 * Function to send messages to riemann.
137 * Acquires the host lock, disconnects on errors.
139 static int wrr_send_nolock(struct riemann_host *host,
140 riemann_message_t *msg) /* {{{ */
144 status = wrr_connect(host);
149 status = riemann_client_send_message(host->client, msg);
151 wrr_disconnect(host);
156 * For TCP we need to receive message acknowledgemenent.
158 if (host->client_type != RIEMANN_CLIENT_UDP) {
159 riemann_message_t *response;
161 response = riemann_client_recv_message(host->client);
163 if (response == NULL) {
164 wrr_disconnect(host);
167 riemann_message_free(response);
171 } /* }}} int wrr_send */
173 static int wrr_send(struct riemann_host *host, riemann_message_t *msg) {
176 pthread_mutex_lock(&host->lock);
177 status = wrr_send_nolock(host, msg);
178 pthread_mutex_unlock(&host->lock);
182 static riemann_message_t *
183 wrr_notification_to_message(struct riemann_host *host, /* {{{ */
184 notification_t const *n) {
185 riemann_message_t *msg;
186 riemann_event_t *event;
187 char service_buffer[6 * DATA_MAX_NAME_LEN];
188 char const *severity;
190 switch (n->severity) {
195 severity = "warning";
198 severity = "critical";
201 severity = "unknown";
204 format_name(service_buffer, sizeof(service_buffer),
205 /* host = */ "", n->plugin, n->plugin_instance, n->type,
208 event = riemann_event_create(
209 RIEMANN_EVENT_FIELD_HOST, n->host, RIEMANN_EVENT_FIELD_TIME,
210 (int64_t)CDTIME_T_TO_TIME_T(n->time), RIEMANN_EVENT_FIELD_TAGS,
211 "notification", NULL, RIEMANN_EVENT_FIELD_STATE, severity,
212 RIEMANN_EVENT_FIELD_SERVICE, &service_buffer[1],
213 RIEMANN_EVENT_FIELD_NONE);
216 riemann_event_string_attribute_add(event, "host", n->host);
217 if (n->plugin[0] != 0)
218 riemann_event_string_attribute_add(event, "plugin", n->plugin);
219 if (n->plugin_instance[0] != 0)
220 riemann_event_string_attribute_add(event, "plugin_instance",
224 riemann_event_string_attribute_add(event, "type", n->type);
225 if (n->type_instance[0] != 0)
226 riemann_event_string_attribute_add(event, "type_instance",
229 for (size_t i = 0; i < riemann_attrs_num; i += 2)
230 riemann_event_string_attribute_add(event, riemann_attrs[i],
231 riemann_attrs[i + 1]);
233 for (size_t i = 0; i < riemann_tags_num; i++)
234 riemann_event_tag_add(event, riemann_tags[i]);
236 if (n->message[0] != 0)
237 riemann_event_string_attribute_add(event, "description", n->message);
239 /* Pull in values from threshold and add extra attributes */
240 for (notification_meta_t *meta = n->meta; meta != NULL; meta = meta->next) {
241 if (strcasecmp("CurrentValue", meta->name) == 0 &&
242 meta->type == NM_TYPE_DOUBLE) {
243 riemann_event_set(event, RIEMANN_EVENT_FIELD_METRIC_D,
244 (double)meta->nm_value.nm_double,
245 RIEMANN_EVENT_FIELD_NONE);
249 if (meta->type == NM_TYPE_STRING) {
250 riemann_event_string_attribute_add(event, meta->name,
251 meta->nm_value.nm_string);
256 msg = riemann_message_create_with_events(event, NULL);
258 ERROR("write_riemann plugin: riemann_message_create_with_events() failed.");
259 riemann_event_free(event);
263 DEBUG("write_riemann plugin: Successfully created message for notification: "
264 "host = \"%s\", service = \"%s\", state = \"%s\"",
265 event->host, event->service, event->state);
267 } /* }}} riemann_message_t *wrr_notification_to_message */
269 static riemann_event_t *
270 wrr_value_to_event(struct riemann_host const *host, /* {{{ */
271 data_set_t const *ds, value_list_t const *vl, size_t index,
272 gauge_t const *rates, int status) {
273 riemann_event_t *event;
274 char name_buffer[5 * DATA_MAX_NAME_LEN];
275 char service_buffer[6 * DATA_MAX_NAME_LEN];
278 event = riemann_event_new();
280 ERROR("write_riemann plugin: riemann_event_new() failed.");
284 format_name(name_buffer, sizeof(name_buffer),
285 /* host = */ "", vl->plugin, vl->plugin_instance, vl->type,
287 if (host->always_append_ds || (ds->ds_num > 1)) {
288 if (host->event_service_prefix == NULL)
289 ssnprintf(service_buffer, sizeof(service_buffer), "%s/%s",
290 &name_buffer[1], ds->ds[index].name);
292 ssnprintf(service_buffer, sizeof(service_buffer), "%s%s/%s",
293 host->event_service_prefix, &name_buffer[1],
296 if (host->event_service_prefix == NULL)
297 sstrncpy(service_buffer, &name_buffer[1], sizeof(service_buffer));
299 ssnprintf(service_buffer, sizeof(service_buffer), "%s%s",
300 host->event_service_prefix, &name_buffer[1]);
304 event, RIEMANN_EVENT_FIELD_HOST, vl->host, RIEMANN_EVENT_FIELD_TIME,
305 (int64_t)CDTIME_T_TO_TIME_T(vl->time), RIEMANN_EVENT_FIELD_TTL,
306 (float)CDTIME_T_TO_DOUBLE(vl->interval) * host->ttl_factor,
307 RIEMANN_EVENT_FIELD_STRING_ATTRIBUTES, "plugin", vl->plugin, "type",
308 vl->type, "ds_name", ds->ds[index].name, NULL,
309 RIEMANN_EVENT_FIELD_SERVICE, service_buffer, RIEMANN_EVENT_FIELD_NONE);
311 if (host->check_thresholds) {
312 const char *state = NULL;
329 riemann_event_set(event, RIEMANN_EVENT_FIELD_STATE, state,
330 RIEMANN_EVENT_FIELD_NONE);
333 if (vl->plugin_instance[0] != 0)
334 riemann_event_string_attribute_add(event, "plugin_instance",
335 vl->plugin_instance);
336 if (vl->type_instance[0] != 0)
337 riemann_event_string_attribute_add(event, "type_instance",
340 if ((ds->ds[index].type != DS_TYPE_GAUGE) && (rates != NULL)) {
341 char ds_type[DATA_MAX_NAME_LEN];
343 ssnprintf(ds_type, sizeof(ds_type), "%s:rate",
344 DS_TYPE_TO_STRING(ds->ds[index].type));
345 riemann_event_string_attribute_add(event, "ds_type", ds_type);
347 riemann_event_string_attribute_add(event, "ds_type",
348 DS_TYPE_TO_STRING(ds->ds[index].type));
352 char ds_index[DATA_MAX_NAME_LEN];
354 ssnprintf(ds_index, sizeof(ds_index), "%zu", index);
355 riemann_event_string_attribute_add(event, "ds_index", ds_index);
358 for (i = 0; i < riemann_attrs_num; i += 2)
359 riemann_event_string_attribute_add(event, riemann_attrs[i],
360 riemann_attrs[i + 1]);
362 for (i = 0; i < riemann_tags_num; i++)
363 riemann_event_tag_add(event, riemann_tags[i]);
365 if (ds->ds[index].type == DS_TYPE_GAUGE) {
366 riemann_event_set(event, RIEMANN_EVENT_FIELD_METRIC_D,
367 (double)vl->values[index].gauge,
368 RIEMANN_EVENT_FIELD_NONE);
369 } else if (rates != NULL) {
370 riemann_event_set(event, RIEMANN_EVENT_FIELD_METRIC_D, (double)rates[index],
371 RIEMANN_EVENT_FIELD_NONE);
375 if (ds->ds[index].type == DS_TYPE_DERIVE)
376 metric = (int64_t)vl->values[index].derive;
377 else if (ds->ds[index].type == DS_TYPE_ABSOLUTE)
378 metric = (int64_t)vl->values[index].absolute;
380 metric = (int64_t)vl->values[index].counter;
382 riemann_event_set(event, RIEMANN_EVENT_FIELD_METRIC_S64, (int64_t)metric,
383 RIEMANN_EVENT_FIELD_NONE);
386 DEBUG("write_riemann plugin: Successfully created message for metric: "
387 "host = \"%s\", service = \"%s\"",
388 event->host, event->service);
390 } /* }}} riemann_event_t *wrr_value_to_event */
392 static riemann_message_t *
393 wrr_value_list_to_message(struct riemann_host const *host, /* {{{ */
394 data_set_t const *ds, value_list_t const *vl,
396 riemann_message_t *msg;
398 gauge_t *rates = NULL;
400 /* Initialize the Msg structure. */
401 msg = riemann_message_new();
403 ERROR("write_riemann plugin: riemann_message_new failed.");
407 if (host->store_rates) {
408 rates = uc_get_rate(ds, vl);
410 ERROR("write_riemann plugin: uc_get_rate failed.");
411 riemann_message_free(msg);
416 for (i = 0; i < vl->values_len; i++) {
417 riemann_event_t *event;
419 event = wrr_value_to_event(host, ds, vl, (int)i, rates, statuses[i]);
421 riemann_message_free(msg);
425 riemann_message_append_events(msg, event, NULL);
430 } /* }}} riemann_message_t *wrr_value_list_to_message */
433 * Always call while holding host->lock !
435 static int wrr_batch_flush_nolock(cdtime_t timeout, struct riemann_host *host) {
441 if ((host->batch_init + timeout) > now) {
445 wrr_send_nolock(host, host->batch_msg);
446 riemann_message_free(host->batch_msg);
448 host->batch_init = now;
449 host->batch_msg = NULL;
453 static int wrr_batch_flush(cdtime_t timeout,
454 const char *identifier __attribute__((unused)),
455 user_data_t *user_data) {
456 struct riemann_host *host;
459 if (user_data == NULL)
462 host = user_data->data;
463 pthread_mutex_lock(&host->lock);
464 status = wrr_batch_flush_nolock(timeout, host);
467 LOG_ERR, &host->init_complaint,
468 "write_riemann plugin: riemann_client_send failed with status %i",
471 c_release(LOG_DEBUG, &host->init_complaint,
472 "write_riemann plugin: batch sent.");
474 pthread_mutex_unlock(&host->lock);
478 static int wrr_batch_add_value_list(struct riemann_host *host, /* {{{ */
479 data_set_t const *ds,
480 value_list_t const *vl, int *statuses) {
481 riemann_message_t *msg;
486 msg = wrr_value_list_to_message(host, ds, vl, statuses);
490 pthread_mutex_lock(&host->lock);
492 if (host->batch_msg == NULL) {
493 host->batch_msg = msg;
497 status = riemann_message_append_events_n(host->batch_msg, msg->n_events,
502 riemann_message_free(msg);
505 pthread_mutex_unlock(&host->lock);
506 ERROR("write_riemann plugin: out of memory");
511 len = riemann_message_get_packed_size(host->batch_msg);
513 if ((host->batch_max < 0) || (((size_t)host->batch_max) <= len)) {
514 ret = wrr_batch_flush_nolock(0, host);
516 if (host->batch_timeout > 0) {
517 timeout = TIME_T_TO_CDTIME_T((time_t)host->batch_timeout);
518 ret = wrr_batch_flush_nolock(timeout, host);
522 pthread_mutex_unlock(&host->lock);
524 } /* }}} riemann_message_t *wrr_batch_add_value_list */
526 static int wrr_notification(const notification_t *n, user_data_t *ud) /* {{{ */
529 struct riemann_host *host = ud->data;
530 riemann_message_t *msg;
532 if (!host->notifications)
536 * Never batch for notifications, send them ASAP
538 msg = wrr_notification_to_message(host, n);
542 status = wrr_send(host, msg);
545 LOG_ERR, &host->init_complaint,
546 "write_riemann plugin: riemann_client_send failed with status %i",
549 c_release(LOG_DEBUG, &host->init_complaint,
550 "write_riemann plugin: riemann_client_send succeeded");
552 riemann_message_free(msg);
554 } /* }}} int wrr_notification */
556 static int wrr_write(const data_set_t *ds, /* {{{ */
557 const value_list_t *vl, user_data_t *ud) {
559 int statuses[vl->values_len];
560 struct riemann_host *host = ud->data;
561 riemann_message_t *msg;
563 if (host->check_thresholds) {
564 status = write_riemann_threshold_check(ds, vl, statuses);
568 memset(statuses, 0, sizeof(statuses));
571 if (host->client_type != RIEMANN_CLIENT_UDP && host->batch_mode) {
572 wrr_batch_add_value_list(host, ds, vl, statuses);
574 msg = wrr_value_list_to_message(host, ds, vl, statuses);
578 status = wrr_send(host, msg);
580 riemann_message_free(msg);
583 } /* }}} int wrr_write */
585 static void wrr_free(void *p) /* {{{ */
587 struct riemann_host *host = p;
592 pthread_mutex_lock(&host->lock);
594 host->reference_count--;
595 if (host->reference_count > 0) {
596 pthread_mutex_unlock(&host->lock);
600 wrr_disconnect(host);
602 pthread_mutex_destroy(&host->lock);
604 } /* }}} void wrr_free */
606 static int wrr_config_node(oconfig_item_t *ci) /* {{{ */
608 struct riemann_host *host = NULL;
611 oconfig_item_t *child;
612 char callback_name[DATA_MAX_NAME_LEN];
615 if ((host = calloc(1, sizeof(*host))) == NULL) {
616 ERROR("write_riemann plugin: calloc failed.");
619 pthread_mutex_init(&host->lock, NULL);
620 C_COMPLAIN_INIT(&host->init_complaint);
621 host->reference_count = 1;
624 host->notifications = 1;
625 host->check_thresholds = 0;
626 host->store_rates = 1;
627 host->always_append_ds = 0;
628 host->batch_mode = 1;
629 host->batch_max = RIEMANN_BATCH_MAX; /* typical MSS */
630 host->batch_init = cdtime();
631 host->batch_timeout = 0;
632 host->ttl_factor = RIEMANN_TTL_FACTOR;
634 host->client_type = RIEMANN_CLIENT_TCP;
635 host->timeout.tv_sec = 0;
636 host->timeout.tv_usec = 0;
638 status = cf_util_get_string(ci, &host->name);
640 WARNING("write_riemann plugin: Required host name is missing.");
645 for (i = 0; i < ci->children_num; i++) {
647 * The code here could be simplified but makes room
648 * for easy adding of new options later on.
650 child = &ci->children[i];
653 if (strcasecmp("Host", child->key) == 0) {
654 status = cf_util_get_string(child, &host->node);
657 } else if (strcasecmp("Notifications", child->key) == 0) {
658 status = cf_util_get_boolean(child, &host->notifications);
661 } else if (strcasecmp("EventServicePrefix", child->key) == 0) {
662 status = cf_util_get_string(child, &host->event_service_prefix);
665 } else if (strcasecmp("CheckThresholds", child->key) == 0) {
666 status = cf_util_get_boolean(child, &host->check_thresholds);
669 } else if (strcasecmp("Batch", child->key) == 0) {
670 status = cf_util_get_boolean(child, &host->batch_mode);
673 } else if (strcasecmp("BatchMaxSize", child->key) == 0) {
674 status = cf_util_get_int(child, &host->batch_max);
677 } else if (strcasecmp("BatchFlushTimeout", child->key) == 0) {
678 status = cf_util_get_int(child, &host->batch_timeout);
681 } else if (strcasecmp("Timeout", child->key) == 0) {
682 status = cf_util_get_int(child, (int *)&host->timeout.tv_sec);
685 } else if (strcasecmp("Port", child->key) == 0) {
686 host->port = cf_util_get_port_number(child);
687 if (host->port == -1) {
688 ERROR("write_riemann plugin: Invalid argument "
689 "configured for the \"Port\" "
693 } else if (strcasecmp("Protocol", child->key) == 0) {
695 status = cf_util_get_string_buffer(child, tmp, sizeof(tmp));
697 ERROR("write_riemann plugin: cf_util_get_"
698 "string_buffer failed with "
704 if (strcasecmp("UDP", tmp) == 0)
705 host->client_type = RIEMANN_CLIENT_UDP;
706 else if (strcasecmp("TCP", tmp) == 0)
707 host->client_type = RIEMANN_CLIENT_TCP;
708 else if (strcasecmp("TLS", tmp) == 0)
709 host->client_type = RIEMANN_CLIENT_TLS;
711 WARNING("write_riemann plugin: The value "
712 "\"%s\" is not valid for the "
713 "\"Protocol\" option. Use "
714 "either \"UDP\", \"TCP\" or \"TLS\".",
716 } else if (strcasecmp("TLSCAFile", child->key) == 0) {
717 status = cf_util_get_string(child, &host->tls_ca_file);
719 ERROR("write_riemann plugin: cf_util_get_"
720 "string_buffer failed with "
725 } else if (strcasecmp("TLSCertFile", child->key) == 0) {
726 status = cf_util_get_string(child, &host->tls_cert_file);
728 ERROR("write_riemann plugin: cf_util_get_"
729 "string_buffer failed with "
734 } else if (strcasecmp("TLSKeyFile", child->key) == 0) {
735 status = cf_util_get_string(child, &host->tls_key_file);
737 ERROR("write_riemann plugin: cf_util_get_"
738 "string_buffer failed with "
743 } else if (strcasecmp("StoreRates", child->key) == 0) {
744 status = cf_util_get_boolean(child, &host->store_rates);
747 } else if (strcasecmp("AlwaysAppendDS", child->key) == 0) {
748 status = cf_util_get_boolean(child, &host->always_append_ds);
751 } else if (strcasecmp("TTLFactor", child->key) == 0) {
753 status = cf_util_get_double(child, &tmp);
757 host->ttl_factor = tmp;
758 } else if (tmp >= 1.0) {
759 NOTICE("write_riemann plugin: The configured "
760 "TTLFactor is very small "
761 "(%.1f). A value of 2.0 or "
762 "greater is recommended.",
764 host->ttl_factor = tmp;
765 } else if (tmp > 0.0) {
766 WARNING("write_riemann plugin: The configured "
767 "TTLFactor is too small to be "
768 "useful (%.1f). I'll use it "
769 "since the user knows best, "
770 "but under protest.",
772 host->ttl_factor = tmp;
773 } else { /* zero, negative and NAN */
774 ERROR("write_riemann plugin: The configured "
775 "TTLFactor is invalid (%.1f).",
779 WARNING("write_riemann plugin: ignoring unknown config "
789 ssnprintf(callback_name, sizeof(callback_name), "write_riemann/%s",
792 ud.free_func = wrr_free;
794 pthread_mutex_lock(&host->lock);
796 status = plugin_register_write(callback_name, wrr_write, &ud);
798 if (host->client_type != RIEMANN_CLIENT_UDP && host->batch_mode) {
800 plugin_register_flush(callback_name, wrr_batch_flush, &ud);
803 WARNING("write_riemann plugin: plugin_register_write (\"%s\") "
804 "failed with status %i.",
805 callback_name, status);
807 host->reference_count++;
809 status = plugin_register_notification(callback_name, wrr_notification, &ud);
811 WARNING("write_riemann plugin: plugin_register_notification (\"%s\") "
812 "failed with status %i.",
813 callback_name, status);
815 host->reference_count++;
817 if (host->reference_count <= 1) {
818 /* Both callbacks failed => free memory.
819 * We need to unlock here, because riemann_free() will lock.
820 * This is not a race condition, because we're the only one
821 * holding a reference. */
822 pthread_mutex_unlock(&host->lock);
827 host->reference_count--;
828 pthread_mutex_unlock(&host->lock);
831 } /* }}} int wrr_config_node */
833 static int wrr_config(oconfig_item_t *ci) /* {{{ */
836 oconfig_item_t *child;
839 for (i = 0; i < ci->children_num; i++) {
840 child = &ci->children[i];
842 if (strcasecmp("Node", child->key) == 0) {
843 wrr_config_node(child);
844 } else if (strcasecmp(child->key, "attribute") == 0) {
848 if (child->values_num != 2) {
849 WARNING("riemann attributes need both a key and a value.");
852 if (child->values[0].type != OCONFIG_TYPE_STRING ||
853 child->values[1].type != OCONFIG_TYPE_STRING) {
854 WARNING("riemann attribute needs string arguments.");
857 if ((key = strdup(child->values[0].value.string)) == NULL) {
858 WARNING("cannot allocate memory for attribute key.");
861 if ((val = strdup(child->values[1].value.string)) == NULL) {
862 WARNING("cannot allocate memory for attribute value.");
866 strarray_add(&riemann_attrs, &riemann_attrs_num, key);
867 strarray_add(&riemann_attrs, &riemann_attrs_num, val);
868 DEBUG("write_riemann: got attr: %s => %s", key, val);
871 } else if (strcasecmp(child->key, "tag") == 0) {
873 status = cf_util_get_string(child, &tmp);
877 strarray_add(&riemann_tags, &riemann_tags_num, tmp);
878 DEBUG("write_riemann plugin: Got tag: %s", tmp);
881 WARNING("write_riemann plugin: Ignoring unknown "
882 "configuration option \"%s\" at top level.",
887 } /* }}} int wrr_config */
889 void module_register(void) {
890 plugin_register_complex_config("write_riemann", wrr_config);
893 /* vim: set sw=8 sts=8 ts=8 noet : */