#include "utils_complain.h"
#include "write_riemann_threshold.h"
-#include <errno.h>
#include <riemann/riemann-client.h>
#define RIEMANN_HOST "localhost"
node, port);
return -1;
}
+#if RCC_VERSION_NUMBER >= 0x010800
if (host->timeout.tv_sec != 0) {
if (riemann_client_set_timeout(host->client, &host->timeout) != 0) {
riemann_client_free(host->client);
return -1;
}
}
+#endif
set_sock_opts(riemann_client_get_fd(host->client));
if (status != 0)
break;
} else if (strcasecmp("Timeout", child->key) == 0) {
+#if RCC_VERSION_NUMBER >= 0x010800
status = cf_util_get_int(child, (int *)&host->timeout.tv_sec);
if (status != 0)
break;
+#else
+ WARNING("write_riemann plugin: The Timeout option is not supported. "
+ "Please upgrade the Riemann client to at least 1.8.0.");
+#endif
} else if (strcasecmp("Port", child->key) == 0) {
host->port = cf_util_get_port_number(child);
if (host->port == -1) {
ssnprintf(callback_name, sizeof(callback_name), "write_riemann/%s",
host->name);
- user_data_t ud = {
- .data = host,
- .free_func = wrr_free
- };
+ user_data_t ud = {.data = host, .free_func = wrr_free};
pthread_mutex_lock(&host->lock);
void module_register(void) {
plugin_register_complex_config("write_riemann", wrr_config);
}
-
-/* vim: set sw=8 sts=8 ts=8 noet : */