summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ec9ed6f)
raw | patch | inline | side by side (parent: ec9ed6f)
author | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Thu, 11 Aug 2016 17:38:17 +0000 (19:38 +0200) | ||
committer | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Mon, 15 Aug 2016 08:50:48 +0000 (10:50 +0200) |
riemann_client_set_timeout() was added in 1.8.0, but this
version hasn't landed in all distro's yet.
Fixes #986
version hasn't landed in all distro's yet.
Fixes #986
configure.ac | patch | blob | history | |
src/write_riemann.c | patch | blob | history |
diff --git a/configure.ac b/configure.ac
index 8dda7104514bd760b0f8373004c09bb99b5b4162..86a697851df4d45303bfca2a4e62b95aece96c66 100644 (file)
--- a/configure.ac
+++ b/configure.ac
[with_libnotify="no (pkg-config doesn't know libnotify)"]
)
-PKG_CHECK_MODULES([LIBRIEMANN_CLIENT], [riemann-client >= 1.8.0],
+PKG_CHECK_MODULES([LIBRIEMANN_CLIENT], [riemann-client >= 1.6.0],
[with_libriemann_client="yes"],
[with_libriemann_client="no (pkg-config doesn't know libriemann-client)"])
diff --git a/src/write_riemann.c b/src/write_riemann.c
index f143723431e0dafd8b88259a5e7d074be3e0c359..5282b1dd83f8b063715b843f71e27df3b5726dc0 100644 (file)
--- a/src/write_riemann.c
+++ b/src/write_riemann.c
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) {