X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fwrite_riemann.c;h=92c8d0caa11b571f4bd1cc957899cd33ff5d7b5e;hb=51181b899668ad2c232a152d6e5e787c4eb049cc;hp=043a06b0a55e9b1dfdf01291f253fc02586ce322;hpb=e2ff4dd149e85527eba7a38a8f38aeb3b548f39c;p=collectd.git diff --git a/src/write_riemann.c b/src/write_riemann.c index 043a06b0..92c8d0ca 100644 --- a/src/write_riemann.c +++ b/src/write_riemann.c @@ -36,7 +36,6 @@ #include "utils_complain.h" #include "write_riemann_threshold.h" -#include #include #define RIEMANN_HOST "localhost" @@ -100,6 +99,7 @@ static int wrr_connect(struct riemann_host *host) /* {{{ */ 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); @@ -110,6 +110,7 @@ static int wrr_connect(struct riemann_host *host) /* {{{ */ return -1; } } +#endif set_sock_opts(riemann_client_get_fd(host->client)); @@ -679,9 +680,13 @@ static int wrr_config_node(oconfig_item_t *ci) /* {{{ */ 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) {