projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rrdcached plugin: Inline time conversion.
[collectd.git]
/
src
/
write_riemann.c
diff --git
a/src/write_riemann.c
b/src/write_riemann.c
index
45f9219
..
62ddc67
100644
(file)
--- a/
src/write_riemann.c
+++ b/
src/write_riemann.c
@@
-30,8
+30,8
@@
#include "collectd.h"
#include "collectd.h"
-#include "common.h"
#include "plugin.h"
#include "plugin.h"
+#include "utils/common/common.h"
#include "utils_cache.h"
#include "utils_complain.h"
#include "write_riemann_threshold.h"
#include "utils_cache.h"
#include "utils_complain.h"
#include "write_riemann_threshold.h"
@@
-181,9
+181,7
@@
static int wrr_send(struct riemann_host *host, riemann_message_t *msg) {
return status;
}
return status;
}
-static riemann_message_t *
-wrr_notification_to_message(struct riemann_host *host, /* {{{ */
- notification_t const *n) {
+static riemann_message_t *wrr_notification_to_message(notification_t const *n) {
riemann_message_t *msg;
riemann_event_t *event;
char service_buffer[6 * DATA_MAX_NAME_LEN];
riemann_message_t *msg;
riemann_event_t *event;
char service_buffer[6 * DATA_MAX_NAME_LEN];
@@
-271,7
+269,7
@@
wrr_notification_to_message(struct riemann_host *host, /* {{{ */
"host = \"%s\", service = \"%s\", state = \"%s\"",
event->host, event->service, event->state);
return msg;
"host = \"%s\", service = \"%s\", state = \"%s\"",
event->host, event->service, event->state);
return msg;
-}
/* }}} riemann_message_t *wrr_notification_to_message */
+}
static riemann_event_t *
wrr_value_to_event(struct riemann_host const *host, /* {{{ */
static riemann_event_t *
wrr_value_to_event(struct riemann_host const *host, /* {{{ */
@@
-546,7
+544,7
@@
static int wrr_notification(const notification_t *n, user_data_t *ud) /* {{{ */
/*
* Never batch for notifications, send them ASAP
*/
/*
* Never batch for notifications, send them ASAP
*/
- msg = wrr_notification_to_message(
host,
n);
+ msg = wrr_notification_to_message(n);
if (msg == NULL)
return -1;
if (msg == NULL)
return -1;
@@
-701,21
+699,13
@@
static int wrr_config_node(oconfig_item_t *ci) /* {{{ */
} else if (strcasecmp("Port", child->key) == 0) {
host->port = cf_util_get_port_number(child);
if (host->port == -1) {
} else if (strcasecmp("Port", child->key) == 0) {
host->port = cf_util_get_port_number(child);
if (host->port == -1) {
- ERROR("write_riemann plugin: Invalid argument "
- "configured for the \"Port\" "
- "option.");
break;
}
} else if (strcasecmp("Protocol", child->key) == 0) {
char tmp[16];
status = cf_util_get_string_buffer(child, tmp, sizeof(tmp));
break;
}
} else if (strcasecmp("Protocol", child->key) == 0) {
char tmp[16];
status = cf_util_get_string_buffer(child, tmp, sizeof(tmp));
- if (status != 0) {
- ERROR("write_riemann plugin: cf_util_get_"
- "string_buffer failed with "
- "status %i.",
- status);
+ if (status != 0)
break;
break;
- }
if (strcasecmp("UDP", tmp) == 0)
host->client_type = RIEMANN_CLIENT_UDP;
if (strcasecmp("UDP", tmp) == 0)
host->client_type = RIEMANN_CLIENT_UDP;
@@
-731,31
+721,16
@@
static int wrr_config_node(oconfig_item_t *ci) /* {{{ */
tmp);
} else if (strcasecmp("TLSCAFile", child->key) == 0) {
status = cf_util_get_string(child, &host->tls_ca_file);
tmp);
} else if (strcasecmp("TLSCAFile", child->key) == 0) {
status = cf_util_get_string(child, &host->tls_ca_file);
- if (status != 0) {
- ERROR("write_riemann plugin: cf_util_get_"
- "string_buffer failed with "
- "status %i.",
- status);
+ if (status != 0)
break;
break;
- }
} else if (strcasecmp("TLSCertFile", child->key) == 0) {
status = cf_util_get_string(child, &host->tls_cert_file);
} else if (strcasecmp("TLSCertFile", child->key) == 0) {
status = cf_util_get_string(child, &host->tls_cert_file);
- if (status != 0) {
- ERROR("write_riemann plugin: cf_util_get_"
- "string_buffer failed with "
- "status %i.",
- status);
+ if (status != 0)
break;
break;
- }
} else if (strcasecmp("TLSKeyFile", child->key) == 0) {
status = cf_util_get_string(child, &host->tls_key_file);
} else if (strcasecmp("TLSKeyFile", child->key) == 0) {
status = cf_util_get_string(child, &host->tls_key_file);
- if (status != 0) {
- ERROR("write_riemann plugin: cf_util_get_"
- "string_buffer failed with "
- "status %i.",
- status);
+ if (status != 0)
break;
break;
- }
} else if (strcasecmp("StoreRates", child->key) == 0) {
status = cf_util_get_boolean(child, &host->store_rates);
if (status != 0)
} else if (strcasecmp("StoreRates", child->key) == 0) {
status = cf_util_get_boolean(child, &host->store_rates);
if (status != 0)