X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fwrite_riemann.c;h=f143723431e0dafd8b88259a5e7d074be3e0c359;hb=74e5c6f352b98b6f6bc0b0efac36dd182b94186e;hp=261327a37b750796c603e990650cb45e70e5d89a;hpb=3fae5596643f1e361eb18c3d65448f8bc02fdd80;p=collectd.git diff --git a/src/write_riemann.c b/src/write_riemann.c index 261327a3..f1437234 100644 --- a/src/write_riemann.c +++ b/src/write_riemann.c @@ -112,6 +112,8 @@ static int wrr_connect(struct riemann_host *host) /* {{{ */ } } + set_sock_opts(riemann_client_get_fd(host->client)); + c_release(LOG_INFO, &host->init_complaint, "write_riemann plugin: Successfully connected to %s:%d", node, port); @@ -186,8 +188,6 @@ wrr_notification_to_message(struct riemann_host *host, /* {{{ */ riemann_event_t *event; char service_buffer[6 * DATA_MAX_NAME_LEN]; char const *severity; - notification_meta_t *meta; - size_t i; switch (n->severity) { case NOTIF_OKAY: @@ -228,18 +228,18 @@ wrr_notification_to_message(struct riemann_host *host, /* {{{ */ riemann_event_string_attribute_add(event, "type_instance", n->type_instance); - for (i = 0; i < riemann_attrs_num; i += 2) + for (size_t i = 0; i < riemann_attrs_num; i += 2) riemann_event_string_attribute_add(event, riemann_attrs[i], riemann_attrs[i + 1]); - for (i = 0; i < riemann_tags_num; i++) + for (size_t i = 0; i < riemann_tags_num; i++) riemann_event_tag_add(event, riemann_tags[i]); if (n->message[0] != 0) riemann_event_string_attribute_add(event, "description", n->message); /* Pull in values from threshold and add extra attributes */ - for (meta = n->meta; meta != NULL; meta = meta->next) { + for (notification_meta_t *meta = n->meta; meta != NULL; meta = meta->next) { if (strcasecmp("CurrentValue", meta->name) == 0 && meta->type == NM_TYPE_DOUBLE) { riemann_event_set(event, RIEMANN_EVENT_FIELD_METRIC_D,