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>
35 #include "utils_cache.h"
36 #include "utils_complain.h"
37 #include "write_riemann_threshold.h"
40 #include <riemann/riemann-client.h>
42 #define RIEMANN_HOST "localhost"
43 #define RIEMANN_PORT 5555
44 #define RIEMANN_TTL_FACTOR 2.0
45 #define RIEMANN_BATCH_MAX 8192
48 c_complain_t init_complaint;
50 char *event_service_prefix;
54 _Bool check_thresholds;
56 _Bool always_append_ds;
59 riemann_client_type_t client_type;
60 riemann_client_t *client;
66 riemann_message_t *batch_msg;
70 struct timeval timeout;
73 static char **riemann_tags;
74 static size_t riemann_tags_num;
75 static char **riemann_attrs;
76 static size_t riemann_attrs_num;
78 /* host->lock must be held when calling this function. */
79 static int wrr_connect(struct riemann_host *host) /* {{{ */
87 node = (host->node != NULL) ? host->node : RIEMANN_HOST;
88 port = (host->port) ? host->port : RIEMANN_PORT;
92 host->client = riemann_client_create(
93 host->client_type, node, port, RIEMANN_CLIENT_OPTION_TLS_CA_FILE,
94 host->tls_ca_file, RIEMANN_CLIENT_OPTION_TLS_CERT_FILE,
95 host->tls_cert_file, RIEMANN_CLIENT_OPTION_TLS_KEY_FILE,
96 host->tls_key_file, RIEMANN_CLIENT_OPTION_NONE);
97 if (host->client == NULL) {
98 c_complain(LOG_ERR, &host->init_complaint,
99 "write_riemann plugin: Unable to connect to Riemann at %s:%d",
103 if (host->timeout.tv_sec != 0) {
104 if (riemann_client_set_timeout(host->client, &host->timeout) != 0) {
105 riemann_client_free(host->client);
107 c_complain(LOG_ERR, &host->init_complaint,
108 "write_riemann plugin: Unable to connect to Riemann at %s:%d",
114 set_sock_opts(riemann_client_get_fd(host->client));
116 c_release(LOG_INFO, &host->init_complaint,
117 "write_riemann plugin: Successfully connected to %s:%d", node,
121 } /* }}} int wrr_connect */
123 /* host->lock must be held when calling this function. */
124 static int wrr_disconnect(struct riemann_host *host) /* {{{ */
129 riemann_client_free(host->client);
133 } /* }}} int wrr_disconnect */
136 * Function to send messages to riemann.
138 * Acquires the host lock, disconnects on errors.
140 static int wrr_send_nolock(struct riemann_host *host,
141 riemann_message_t *msg) /* {{{ */
145 status = wrr_connect(host);
150 status = riemann_client_send_message(host->client, msg);
152 wrr_disconnect(host);
157 * For TCP we need to receive message acknowledgemenent.
159 if (host->client_type != RIEMANN_CLIENT_UDP) {
160 riemann_message_t *response;
162 response = riemann_client_recv_message(host->client);
164 if (response == NULL) {
165 wrr_disconnect(host);
168 riemann_message_free(response);
172 } /* }}} int wrr_send */
174 static int wrr_send(struct riemann_host *host, riemann_message_t *msg) {
177 pthread_mutex_lock(&host->lock);
178 status = wrr_send_nolock(host, msg);
179 pthread_mutex_unlock(&host->lock);
183 static riemann_message_t *
184 wrr_notification_to_message(struct riemann_host *host, /* {{{ */
185 notification_t const *n) {
186 riemann_message_t *msg;
187 riemann_event_t *event;
188 char service_buffer[6 * DATA_MAX_NAME_LEN];
189 char const *severity;
191 switch (n->severity) {
196 severity = "warning";
199 severity = "critical";
202 severity = "unknown";
205 format_name(service_buffer, sizeof(service_buffer),
206 /* host = */ "", n->plugin, n->plugin_instance, n->type,
209 event = riemann_event_create(
210 RIEMANN_EVENT_FIELD_HOST, n->host, RIEMANN_EVENT_FIELD_TIME,
211 (int64_t)CDTIME_T_TO_TIME_T(n->time), RIEMANN_EVENT_FIELD_TAGS,
212 "notification", NULL, RIEMANN_EVENT_FIELD_STATE, severity,
213 RIEMANN_EVENT_FIELD_SERVICE, &service_buffer[1],
214 RIEMANN_EVENT_FIELD_NONE);
217 riemann_event_string_attribute_add(event, "host", n->host);
218 if (n->plugin[0] != 0)
219 riemann_event_string_attribute_add(event, "plugin", n->plugin);
220 if (n->plugin_instance[0] != 0)
221 riemann_event_string_attribute_add(event, "plugin_instance",
225 riemann_event_string_attribute_add(event, "type", n->type);
226 if (n->type_instance[0] != 0)
227 riemann_event_string_attribute_add(event, "type_instance",
230 for (size_t i = 0; i < riemann_attrs_num; i += 2)
231 riemann_event_string_attribute_add(event, riemann_attrs[i],
232 riemann_attrs[i + 1]);
234 for (size_t i = 0; i < riemann_tags_num; i++)
235 riemann_event_tag_add(event, riemann_tags[i]);
237 if (n->message[0] != 0)
238 riemann_event_string_attribute_add(event, "description", n->message);
240 /* Pull in values from threshold and add extra attributes */
241 for (notification_meta_t *meta = n->meta; meta != NULL; meta = meta->next) {
242 if (strcasecmp("CurrentValue", meta->name) == 0 &&
243 meta->type == NM_TYPE_DOUBLE) {
244 riemann_event_set(event, RIEMANN_EVENT_FIELD_METRIC_D,
245 (double)meta->nm_value.nm_double,
246 RIEMANN_EVENT_FIELD_NONE);
250 if (meta->type == NM_TYPE_STRING) {
251 riemann_event_string_attribute_add(event, meta->name,
252 meta->nm_value.nm_string);
257 msg = riemann_message_create_with_events(event, NULL);
259 ERROR("write_riemann plugin: riemann_message_create_with_events() failed.");
260 riemann_event_free(event);
264 DEBUG("write_riemann plugin: Successfully created message for notification: "
265 "host = \"%s\", service = \"%s\", state = \"%s\"",
266 event->host, event->service, event->state);
268 } /* }}} riemann_message_t *wrr_notification_to_message */
270 static riemann_event_t *
271 wrr_value_to_event(struct riemann_host const *host, /* {{{ */
272 data_set_t const *ds, value_list_t const *vl, size_t index,
273 gauge_t const *rates, int status) {
274 riemann_event_t *event;
275 char name_buffer[5 * DATA_MAX_NAME_LEN];
276 char service_buffer[6 * DATA_MAX_NAME_LEN];
279 event = riemann_event_new();
281 ERROR("write_riemann plugin: riemann_event_new() failed.");
285 format_name(name_buffer, sizeof(name_buffer),
286 /* host = */ "", vl->plugin, vl->plugin_instance, vl->type,
288 if (host->always_append_ds || (ds->ds_num > 1)) {
289 if (host->event_service_prefix == NULL)
290 ssnprintf(service_buffer, sizeof(service_buffer), "%s/%s",
291 &name_buffer[1], ds->ds[index].name);
293 ssnprintf(service_buffer, sizeof(service_buffer), "%s%s/%s",
294 host->event_service_prefix, &name_buffer[1],
297 if (host->event_service_prefix == NULL)
298 sstrncpy(service_buffer, &name_buffer[1], sizeof(service_buffer));
300 ssnprintf(service_buffer, sizeof(service_buffer), "%s%s",
301 host->event_service_prefix, &name_buffer[1]);
305 event, RIEMANN_EVENT_FIELD_HOST, vl->host, RIEMANN_EVENT_FIELD_TIME,
306 (int64_t)CDTIME_T_TO_TIME_T(vl->time), RIEMANN_EVENT_FIELD_TTL,
307 (float)CDTIME_T_TO_DOUBLE(vl->interval) * host->ttl_factor,
308 RIEMANN_EVENT_FIELD_STRING_ATTRIBUTES, "plugin", vl->plugin, "type",
309 vl->type, "ds_name", ds->ds[index].name, NULL,
310 RIEMANN_EVENT_FIELD_SERVICE, service_buffer, RIEMANN_EVENT_FIELD_NONE);
312 if (host->check_thresholds) {
313 const char *state = NULL;
330 riemann_event_set(event, RIEMANN_EVENT_FIELD_STATE, state,
331 RIEMANN_EVENT_FIELD_NONE);
334 if (vl->plugin_instance[0] != 0)
335 riemann_event_string_attribute_add(event, "plugin_instance",
336 vl->plugin_instance);
337 if (vl->type_instance[0] != 0)
338 riemann_event_string_attribute_add(event, "type_instance",
341 if ((ds->ds[index].type != DS_TYPE_GAUGE) && (rates != NULL)) {
342 char ds_type[DATA_MAX_NAME_LEN];
344 ssnprintf(ds_type, sizeof(ds_type), "%s:rate",
345 DS_TYPE_TO_STRING(ds->ds[index].type));
346 riemann_event_string_attribute_add(event, "ds_type", ds_type);
348 riemann_event_string_attribute_add(event, "ds_type",
349 DS_TYPE_TO_STRING(ds->ds[index].type));
353 char ds_index[DATA_MAX_NAME_LEN];
355 ssnprintf(ds_index, sizeof(ds_index), "%zu", index);
356 riemann_event_string_attribute_add(event, "ds_index", ds_index);
359 for (i = 0; i < riemann_attrs_num; i += 2)
360 riemann_event_string_attribute_add(event, riemann_attrs[i],
361 riemann_attrs[i + 1]);
363 for (i = 0; i < riemann_tags_num; i++)
364 riemann_event_tag_add(event, riemann_tags[i]);
366 if (ds->ds[index].type == DS_TYPE_GAUGE) {
367 riemann_event_set(event, RIEMANN_EVENT_FIELD_METRIC_D,
368 (double)vl->values[index].gauge,
369 RIEMANN_EVENT_FIELD_NONE);
370 } else if (rates != NULL) {
371 riemann_event_set(event, RIEMANN_EVENT_FIELD_METRIC_D, (double)rates[index],
372 RIEMANN_EVENT_FIELD_NONE);
376 if (ds->ds[index].type == DS_TYPE_DERIVE)
377 metric = (int64_t)vl->values[index].derive;
378 else if (ds->ds[index].type == DS_TYPE_ABSOLUTE)
379 metric = (int64_t)vl->values[index].absolute;
381 metric = (int64_t)vl->values[index].counter;
383 riemann_event_set(event, RIEMANN_EVENT_FIELD_METRIC_S64, (int64_t)metric,
384 RIEMANN_EVENT_FIELD_NONE);
387 DEBUG("write_riemann plugin: Successfully created message for metric: "
388 "host = \"%s\", service = \"%s\"",
389 event->host, event->service);
391 } /* }}} riemann_event_t *wrr_value_to_event */
393 static riemann_message_t *
394 wrr_value_list_to_message(struct riemann_host const *host, /* {{{ */
395 data_set_t const *ds, value_list_t const *vl,
397 riemann_message_t *msg;
399 gauge_t *rates = NULL;
401 /* Initialize the Msg structure. */
402 msg = riemann_message_new();
404 ERROR("write_riemann plugin: riemann_message_new failed.");
408 if (host->store_rates) {
409 rates = uc_get_rate(ds, vl);
411 ERROR("write_riemann plugin: uc_get_rate failed.");
412 riemann_message_free(msg);
417 for (i = 0; i < vl->values_len; i++) {
418 riemann_event_t *event;
420 event = wrr_value_to_event(host, ds, vl, (int)i, rates, statuses[i]);
422 riemann_message_free(msg);
426 riemann_message_append_events(msg, event, NULL);
431 } /* }}} riemann_message_t *wrr_value_list_to_message */
434 * Always call while holding host->lock !
436 static int wrr_batch_flush_nolock(cdtime_t timeout, struct riemann_host *host) {
442 if ((host->batch_init + timeout) > now) {
446 wrr_send_nolock(host, host->batch_msg);
447 riemann_message_free(host->batch_msg);
449 host->batch_init = now;
450 host->batch_msg = NULL;
454 static int wrr_batch_flush(cdtime_t timeout,
455 const char *identifier __attribute__((unused)),
456 user_data_t *user_data) {
457 struct riemann_host *host;
460 if (user_data == NULL)
463 host = user_data->data;
464 pthread_mutex_lock(&host->lock);
465 status = wrr_batch_flush_nolock(timeout, host);
468 LOG_ERR, &host->init_complaint,
469 "write_riemann plugin: riemann_client_send failed with status %i",
472 c_release(LOG_DEBUG, &host->init_complaint,
473 "write_riemann plugin: batch sent.");
475 pthread_mutex_unlock(&host->lock);
479 static int wrr_batch_add_value_list(struct riemann_host *host, /* {{{ */
480 data_set_t const *ds,
481 value_list_t const *vl, int *statuses) {
482 riemann_message_t *msg;
487 msg = wrr_value_list_to_message(host, ds, vl, statuses);
491 pthread_mutex_lock(&host->lock);
493 if (host->batch_msg == NULL) {
494 host->batch_msg = msg;
498 status = riemann_message_append_events_n(host->batch_msg, msg->n_events,
503 riemann_message_free(msg);
506 pthread_mutex_unlock(&host->lock);
507 ERROR("write_riemann plugin: out of memory");
512 len = riemann_message_get_packed_size(host->batch_msg);
514 if ((host->batch_max < 0) || (((size_t)host->batch_max) <= len)) {
515 ret = wrr_batch_flush_nolock(0, host);
517 if (host->batch_timeout > 0) {
518 timeout = TIME_T_TO_CDTIME_T((time_t)host->batch_timeout);
519 ret = wrr_batch_flush_nolock(timeout, host);
523 pthread_mutex_unlock(&host->lock);
525 } /* }}} riemann_message_t *wrr_batch_add_value_list */
527 static int wrr_notification(const notification_t *n, user_data_t *ud) /* {{{ */
530 struct riemann_host *host = ud->data;
531 riemann_message_t *msg;
533 if (!host->notifications)
537 * Never batch for notifications, send them ASAP
539 msg = wrr_notification_to_message(host, n);
543 status = wrr_send(host, msg);
546 LOG_ERR, &host->init_complaint,
547 "write_riemann plugin: riemann_client_send failed with status %i",
550 c_release(LOG_DEBUG, &host->init_complaint,
551 "write_riemann plugin: riemann_client_send succeeded");
553 riemann_message_free(msg);
555 } /* }}} int wrr_notification */
557 static int wrr_write(const data_set_t *ds, /* {{{ */
558 const value_list_t *vl, user_data_t *ud) {
560 int statuses[vl->values_len];
561 struct riemann_host *host = ud->data;
562 riemann_message_t *msg;
564 if (host->check_thresholds) {
565 status = write_riemann_threshold_check(ds, vl, statuses);
569 memset(statuses, 0, sizeof(statuses));
572 if (host->client_type != RIEMANN_CLIENT_UDP && host->batch_mode) {
573 wrr_batch_add_value_list(host, ds, vl, statuses);
575 msg = wrr_value_list_to_message(host, ds, vl, statuses);
579 status = wrr_send(host, msg);
581 riemann_message_free(msg);
584 } /* }}} int wrr_write */
586 static void wrr_free(void *p) /* {{{ */
588 struct riemann_host *host = p;
593 pthread_mutex_lock(&host->lock);
595 host->reference_count--;
596 if (host->reference_count > 0) {
597 pthread_mutex_unlock(&host->lock);
601 wrr_disconnect(host);
603 pthread_mutex_destroy(&host->lock);
605 } /* }}} void wrr_free */
607 static int wrr_config_node(oconfig_item_t *ci) /* {{{ */
609 struct riemann_host *host = NULL;
612 oconfig_item_t *child;
613 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",
794 .free_func = wrr_free
797 pthread_mutex_lock(&host->lock);
799 status = plugin_register_write(callback_name, wrr_write, &ud);
801 if (host->client_type != RIEMANN_CLIENT_UDP && host->batch_mode) {
803 plugin_register_flush(callback_name, wrr_batch_flush, &ud);
806 WARNING("write_riemann plugin: plugin_register_write (\"%s\") "
807 "failed with status %i.",
808 callback_name, status);
810 host->reference_count++;
812 status = plugin_register_notification(callback_name, wrr_notification, &ud);
814 WARNING("write_riemann plugin: plugin_register_notification (\"%s\") "
815 "failed with status %i.",
816 callback_name, status);
818 host->reference_count++;
820 if (host->reference_count <= 1) {
821 /* Both callbacks failed => free memory.
822 * We need to unlock here, because riemann_free() will lock.
823 * This is not a race condition, because we're the only one
824 * holding a reference. */
825 pthread_mutex_unlock(&host->lock);
830 host->reference_count--;
831 pthread_mutex_unlock(&host->lock);
834 } /* }}} int wrr_config_node */
836 static int wrr_config(oconfig_item_t *ci) /* {{{ */
839 oconfig_item_t *child;
842 for (i = 0; i < ci->children_num; i++) {
843 child = &ci->children[i];
845 if (strcasecmp("Node", child->key) == 0) {
846 wrr_config_node(child);
847 } else if (strcasecmp(child->key, "attribute") == 0) {
851 if (child->values_num != 2) {
852 WARNING("riemann attributes need both a key and a value.");
855 if (child->values[0].type != OCONFIG_TYPE_STRING ||
856 child->values[1].type != OCONFIG_TYPE_STRING) {
857 WARNING("riemann attribute needs string arguments.");
860 if ((key = strdup(child->values[0].value.string)) == NULL) {
861 WARNING("cannot allocate memory for attribute key.");
864 if ((val = strdup(child->values[1].value.string)) == NULL) {
865 WARNING("cannot allocate memory for attribute value.");
869 strarray_add(&riemann_attrs, &riemann_attrs_num, key);
870 strarray_add(&riemann_attrs, &riemann_attrs_num, val);
871 DEBUG("write_riemann: got attr: %s => %s", key, val);
874 } else if (strcasecmp(child->key, "tag") == 0) {
876 status = cf_util_get_string(child, &tmp);
880 strarray_add(&riemann_tags, &riemann_tags_num, tmp);
881 DEBUG("write_riemann plugin: Got tag: %s", tmp);
884 WARNING("write_riemann plugin: Ignoring unknown "
885 "configuration option \"%s\" at top level.",
890 } /* }}} int wrr_config */
892 void module_register(void) {
893 plugin_register_complex_config("write_riemann", wrr_config);
896 /* vim: set sw=8 sts=8 ts=8 noet : */