author | Florian Forster <octo@collectd.org> | |
Mon, 18 Aug 2014 07:50:34 +0000 (09:50 +0200) | ||
committer | Florian Forster <octo@collectd.org> | |
Mon, 18 Aug 2014 07:50:34 +0000 (09:50 +0200) |
Conflicts:
configure.ac
src/curl_json.c
src/lvm.c
src/write_riemann.c
configure.ac
src/curl_json.c
src/lvm.c
src/write_riemann.c
24 files changed:
diff --cc ChangeLog
Simple merge
diff --cc configure.ac
index 92fd87786d030d39303277ae150c468d3b629e7e,d38cbb5d21f938a4d2c4964af01b50233407edfb..0df5678245b1483dc4810a90c7984db51da39270
--- 1/configure.ac
--- 2/configure.ac
+++ b/configure.ac
return htonll(0);
]]]
)],
- [
- have_htonll="yes"
- AC_DEFINE(HAVE_HTONLL, 1, [Define if the function htonll exists.])
- ])
-
- AC_MSG_RESULT([$have_htonll])
+ [c_cv_have_htonll="yes"],
+ [c_cv_have_htonll="no"]
- )
++ )
+ )
+ if test "x$c_cv_have_htonll" = "xyes"
+ then
+ AC_DEFINE(HAVE_HTONLL, 1, [Define if the function htonll exists.])
+ fi
# Check for structures
AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
CPPFLAGS="$SAVE_CPPFLAGS"
LDFLAGS="$SAVE_LDFLAGS"
AM_CONDITIONAL(BUILD_WITH_LIBRABBITMQ, test "x$with_librabbitmq" = "xyes")
+
+ with_amqp_tcp_socket="no"
+ if test "x$with_librabbitmq" = "xyes"
+ then
+ SAVE_CPPFLAGS="$CPPFLAGS"
+ SAVE_LDFLAGS="$LDFLAGS"
+ SAVE_LIBS="$LIBS"
+ CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
+ LDFLAGS="$LDFLAGS $with_librabbitmq_ldflags"
+ LIBS="-lrabbitmq"
+
+ AC_CHECK_HEADERS(amqp_tcp_socket.h amqp_socket.h)
+ AC_CHECK_FUNC(amqp_tcp_socket_new, [with_amqp_tcp_socket="yes"], [with_amqp_tcp_socket="no"])
+ if test "x$with_amqp_tcp_socket" = "xyes"
+ then
+ AC_DEFINE(HAVE_AMQP_TCP_SOCKET, 1,
+ [Define if librabbitmq provides the new TCP socket interface.])
+ fi
+
+ AC_CHECK_DECLS(amqp_socket_close,
+ [amqp_socket_close_decl="yes"], [amqp_socket_close_decl="no"],
+ [[
+ #include <amqp.h>
+ #ifdef HAVE_AMQP_TCP_SOCKET_H
+ # include <amqp_tcp_socket.h>
+ #endif
+ #ifdef HAVE_AMQP_SOCKET_H
+ # include <amqp_socket.h>
+ #endif
+ ]])
+
+ CPPFLAGS="$SAVE_CPPFLAGS"
+ LDFLAGS="$SAVE_LDFLAGS"
+ LIBS="$SAVE_LIBS"
+ fi
# }}}
+# --with-librdkafka {{{
+AC_ARG_WITH(librdkafka, [AS_HELP_STRING([--with-librdkafka@<:@=PREFIX@:>@], [Path to librdkafka.])],
+[
+ if test "x$withval" = "xno" && test "x$withval" != "xyes"
+ then
+ with_librdkafka_cppflags="-I$withval/include"
+ with_librdkafka_ldflags="-L$withval/lib"
+ with_librdkafka="yes"
+ else
+ with_librdkafka="$withval"
+ fi
+],
+[
+ with_librdkafka="yes"
+])
+SAVE_CPPFLAGS="$CPPFLAGS"
+SAVE_LDFLAGS="$LDFLAGS"
+
+if test "x$with_librdkafka" = "xyes"
+then
+ AC_CHECK_HEADERS(librdkafka/rdkafka.h, [with_librdkafka="yes"], [with_librdkafka="no (librdkafka/rdkafka.h not found)"])
+fi
+
+if test "x$with_librdkafka" = "xyes"
+then
+ AC_CHECK_LIB(rdkafka, rd_kafka_new, [with_librdkafka="yes"], [with_librdkafka="no (Symbol 'rd_kafka_new' not found)"])
+ AC_CHECK_LIB(rdkafka, rd_kafka_conf_set_log_cb, [with_librdkafka_log_cb="yes"], [with_librdkafka_log_cb="no"])
+ AC_CHECK_LIB(rdkafka, rd_kafka_conf_set_logger, [with_librdkafka_logger="yes"], [with_librdkafka_logger="no"])
+fi
+if test "x$with_librdkafka" = "xyes"
+then
+ BUILD_WITH_LIBRDKAFKA_CPPFLAGS="$with_librdkafka_cppflags"
+ BUILD_WITH_LIBRDKAFKA_LDFLAGS="$with_librdkafka_ldflags"
+ BUILD_WITH_LIBRDKAFKA_LIBS="-lrdkafka"
+ AC_SUBST(BUILD_WITH_LIBRDKAFKA_CPPFLAGS)
+ AC_SUBST(BUILD_WITH_LIBRDKAFKA_LDFLAGS)
+ AC_SUBST(BUILD_WITH_LIBRDKAFKA_LIBS)
+ AC_DEFINE(HAVE_LIBRDKAFKA, 1, [Define if librdkafka is present and usable.])
+ if test "x$with_librdkafka_log_cb" = "xyes"
+ then
+ AC_DEFINE(HAVE_LIBRDKAFKA_LOG_CB, 1, [Define if librdkafka log facility is present and usable.])
+ fi
+ if test "x$with_librdkafka_logger" = "xyes"
+ then
+ AC_DEFINE(HAVE_LIBRDKAFKA_LOGGER, 1, [Define if librdkafka log facility is present and usable.])
+ fi
+fi
+CPPFLAGS="$SAVE_CPPFLAGS"
+LDFLAGS="$SAVE_LDFLAGS"
+AM_CONDITIONAL(BUILD_WITH_LIBRDKAFKA, test "x$with_librdkafka" = "xyes")
+
+# }}}
+
# --with-librouteros {{{
AC_ARG_WITH(librouteros, [AS_HELP_STRING([--with-librouteros@<:@=PREFIX@:>@], [Path to librouteros.])],
[
diff --cc contrib/redhat/collectd.spec
Simple merge
diff --cc src/Makefile.am
Simple merge
diff --cc src/amqp.c
Simple merge
diff --cc src/apache.c
Simple merge
diff --cc src/collectd-unixsock.pod
Simple merge
diff --cc src/collectd.conf.in
Simple merge
diff --cc src/collectd.conf.pod
index acd0cbbe1f6a5deb5fc46e0592d954272646936a,81c8f4c6ccd958dcb3cac9d3b9dcadb3aa0d20d3..3a8af849b722a33bdfa08ef44c03c311f0a03cde
+++ b/src/collectd.conf.pod
# StoreRates false
# GraphitePrefix "collectd."
# GraphiteEscapeChar "_"
+ # GraphiteSeparateInstances false
+ # GraphiteAlwaysAppendDS false
</Publish>
-
+
# Receive values from an AMQP broker
<Subscribe "some_name">
Host "localhost"
diff --cc src/common.c
Simple merge
diff --cc src/configfile.c
Simple merge
diff --cc src/curl.c
Simple merge
diff --cc src/curl_json.c
index 6a01590217883d985ee7098934d6387ed1cdee54,9e0f6723c35c363198a3f1df165a6c5e8dcdb444..a84cba042b924d6e3b7667066889ead4ab41ca72
--- 1/src/curl_json.c
--- 2/src/curl_json.c
+++ b/src/curl_json.c
if (status == 0)
{
user_data_t ud;
- char cb_name[DATA_MAX_NAME_LEN];
+ char *cb_name;
+ struct timespec interval = { 0, 0 };
+
+ CDTIME_T_TO_TIMESPEC (db->interval, &interval);
if (db->instance == NULL)
db->instance = strdup("default");
ud.data = (void *) db;
ud.free_func = cj_free;
- ssnprintf (cb_name, sizeof (cb_name), "curl_json-%s-%s",
+ cb_name = ssnprintf_alloc ("curl_json-%s-%s",
db->instance, db->url ? db->url : db->sock);
- plugin_register_complex_read (/* group = */ "curl_json", cb_name, cj_read,
- /* interval = */ NULL, &ud);
+ plugin_register_complex_read (/* group = */ NULL, cb_name, cj_read,
+ /* interval = */ (db->interval > 0) ? &interval : NULL,
+ &ud);
+ sfree (cb_name);
}
else
{
diff --cc src/curl_xml.c
Simple merge
diff --cc src/exec.c
Simple merge
diff --cc src/lvm.c
index 9e245423fef2c829d842619a3a77ee8213864ae4,12c621d0569f7b9d05eabdab9c9f043974cd5e28..82d7f6fef0006854c0b64cd1be712e79a2015901
+++ b/src/lvm.c
lvs = lvm_vg_list_lvs(vg);
if (!lvs) {
/* no VGs are defined, which is not an error per se */
- return (0);
+ return;
}
- return (0);
+ dm_list_iterate_items(lvl, lvs) {
+ lvm_submit(vg_name, lvm_lv_get_name(lvl->lv), lvm_lv_get_size(lvl->lv));
+ }
+
+ dm_list_iterate_items(lvl, lvs) {
+ name = lvm_lv_get_name(lvl->lv);
+ attrs = get_lv_property_string(lvl->lv, "lv_attr");
+ size = lvm_lv_get_size(lvl->lv);
+ if (name == NULL || attrs == NULL || size == NO_VALUE)
+ continue;
+
+ /* Condition on volume type. We want the reported sizes in the
+ volume group to sum to the size of the volume group, so we ignore
+ virtual volumes. */
+ switch (attrs[0]) {
+ case 's':
+ case 'S':
+ /* Snapshot. Also report used/free space. */
+ report_lv_utilization(lvl->lv, vg_name, name, size,
+ "data_percent");
+ break;
+ case 't':
+ /* Thin pool virtual volume. We report the underlying data
+ and metadata volumes, not this one. Report used/free
+ space, then ignore. */
+ report_thin_pool_utilization(lvl->lv, vg_name, size);
+ continue;
+ case 'v':
+ /* Virtual volume. Ignore. */
+ continue;
+ case 'V':
+ /* Thin volume or thin snapshot. Ignore. */
+ continue;
+ }
+ lvm_submit(vg_name, name, size);
+ }
}
static int lvm_read(void)
diff --cc src/network.c
Simple merge
diff --cc src/processes.c
Simple merge
diff --cc src/snmp.c
Simple merge
diff --cc src/tcpconns.c
Simple merge
diff --cc src/utils_vl_lookup.c
Simple merge
diff --cc src/write_http.c
Simple merge
diff --cc src/write_riemann.c
index 78f01c05e51da1d45fcdfe5e209008a184d83ec5,a404ff6e19470f10f52f8926d89b7f5225c037e4..b59c3e35a2fd0082e75d0c8776437d9965b8158f
--- 1/src/write_riemann.c
--- 2/src/write_riemann.c
+++ b/src/write_riemann.c
#define F_CONNECT 0x01
uint8_t flags;
pthread_mutex_t lock;
- _Bool notifications;
- _Bool check_thresholds;
++ _Bool notifications;
++ _Bool check_thresholds;
_Bool store_rates;
_Bool always_append_ds;
char *node;
return (msg);
} /* }}} Msg *riemann_notification_to_protobuf */
- static Event *riemann_value_to_protobuf (struct riemann_host const *host, /* {{{ */
+ static Event *riemann_value_to_protobuf(struct riemann_host const *host, /* {{{ */
data_set_t const *ds,
value_list_t const *vl, size_t index,
- gauge_t const *rates)
+ gauge_t const *rates,
+ int status)
{
Event *event;
char name_buffer[5 * DATA_MAX_NAME_LEN];
event->time = CDTIME_T_TO_TIME_T (vl->time);
event->has_time = 1;
- if (host->check_thresholds) {
- switch (status) {
- case STATE_OKAY:
- event->state = strdup("ok");
- break;
- case STATE_ERROR:
- event->state = strdup("critical");
- break;
- case STATE_WARNING:
- event->state = strdup("warning");
- break;
- case STATE_MISSING:
- event->state = strdup("unknown");
- break;
- }
- }
++ if (host->check_thresholds) {
++ switch (status) {
++ case STATE_OKAY:
++ event->state = strdup("ok");
++ break;
++ case STATE_ERROR:
++ event->state = strdup("critical");
++ break;
++ case STATE_WARNING:
++ event->state = strdup("warning");
++ break;
++ case STATE_MISSING:
++ event->state = strdup("unknown");
++ break;
++ }
++ }
+
ttl = CDTIME_T_TO_DOUBLE (vl->interval) * host->ttl_factor;
event->ttl = (float) ttl;
event->has_ttl = 1;
struct riemann_host *host = ud->data;
Msg *msg;
- if (!host->notifications)
- return 0;
++ if (!host->notifications)
++ return 0;
+
msg = riemann_notification_to_protobuf (host, n);
if (msg == NULL)
return (-1);
struct riemann_host *host = ud->data;
Msg *msg;
- if (host->check_thresholds)
- write_riemann_threshold_check(ds, vl, statuses);
- msg = riemann_value_list_to_protobuf (host, ds, vl);
++ if (host->check_thresholds)
++ write_riemann_threshold_check(ds, vl, statuses);
+ msg = riemann_value_list_to_protobuf (host, ds, vl, statuses);
if (msg == NULL)
return (-1);
host->reference_count = 1;
host->node = NULL;
host->service = NULL;
- host->notifications = 1;
- host->check_thresholds = 0;
++ host->notifications = 1;
++ host->check_thresholds = 0;
host->store_rates = 1;
host->always_append_ds = 0;
host->use_tcp = 0;
status = cf_util_get_string (child, &host->node);
if (status != 0)
break;
- } else if (strcasecmp ("Notifications", child->key) == 0) {
- status = cf_util_get_boolean(child, &host->notifications);
- if (status != 0)
- break;
- } else if (strcasecmp ("CheckThresholds", child->key) == 0) {
- status = cf_util_get_boolean(child, &host->check_thresholds);
- if (status != 0)
- break;
++ } else if (strcasecmp ("Notifications", child->key) == 0) {
++ status = cf_util_get_boolean(child, &host->notifications);
++ if (status != 0)
++ break;
++ } else if (strcasecmp ("CheckThresholds", child->key) == 0) {
++ status = cf_util_get_boolean(child, &host->check_thresholds);
++ if (status != 0)
++ break;
} else if (strcasecmp ("Port", child->key) == 0) {
status = cf_util_get_service (child, &host->service);
if (status != 0) {
diff --cc version-gen.sh
index 7fbc86718d5bafb06cacbe3a85b054b216a847f9,95b15d8a8af3e066a5891f4cbdc859b1bb4615b8..6b5e40e5c90cbfd883b5a810005b8cbfd9a436b8
--- 1/version-gen.sh
--- 2/version-gen.sh
+++ b/version-gen.sh
#!/usr/bin/env bash
- DEFAULT_VERSION="5.4.0.git"
+ DEFAULT_VERSION="5.4.1.git"
-VERSION="`git describe 2> /dev/null | sed -e 's/^collectd-//'`"
+VERSION="`git describe 2> /dev/null | grep collectd | sed -e 's/^collectd-//'`"
if test -z "$VERSION"; then
VERSION="$DEFAULT_VERSION"