Skip to content

Commit

Permalink
Merge branch 'collectd-5.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
octo committed Apr 1, 2012
2 parents efb97f7 + f1ba273 commit ab55c79
Show file tree
Hide file tree
Showing 16 changed files with 540 additions and 79 deletions.
58 changes: 58 additions & 0 deletions ChangeLog
@@ -1,3 +1,32 @@
2012-04-01, Version 5.0.4
* Build system: Fix the use of a libltdl macro. Thanks to Clemens Lang
for fixing this. Adresses some issues with building the iptables
plugin under Gentoo.
* libcollectdclient: A memory leak in the lcc_getval() function has
been fixed. Thanks to Jason Schmidlapp for finding and fixing this
issue.
* bind plugin: The use of 'QType" types has been fixed.
* df plugin: Fixed compiler issue under Mac OS X 10.7.
* conntrack plugin: Support zero as legitimate value. Thanks to Louis
Opter for his patch.
* memcached plugin: Increased the size of a static buffer, which was
truncating status messages form memcached. Thanks to Timon for the
patch.
* network plugin: Forwarding of notifications has been disabled. This
was a contition not checked for before, which may retult in an
endless loop.
* processes plugin: Support for process names with spaces has been
added to the Linux implementation. Thanks to Darrell Bishop for his
patch.
* perl plugin: A race condition in several callbacks, including log and
write callbacks, has been fixed. Thanks to "Rrpv" for reporting this
bug.
* snmp plugin: A bug when casting unsigned integers to gauge values has
been fixed: Unsigned integers would be cast to a signed integer and
then to a gauge, possibly resulting in a negative value.
* tcpconns plugin: Compilation with newer versions of the FreeBSD
runtime has been fixed.

2012-02-19, Version 5.0.3
* Build system: Fix problems when building the ipvs and iptables
plugins. Thanks to Sebastian Harl for his patch. A bashism in the
Expand Down Expand Up @@ -140,6 +169,35 @@
* v5upgrade target: Target for converting v4 data sets to the v5
schema.

2012-04-01, Version 4.10.7
* Build system: Fix the use of a libltdl macro. Thanks to Clemens Lang
for fixing this. Adresses some issues with building the iptables
plugin under Gentoo.
* libcollectdclient: A memory leak in the lcc_getval() function has
been fixed. Thanks to Jason Schmidlapp for finding and fixing this
issue.
* bind plugin: The use of 'QType" types has been fixed.
* df plugin: Fixed compiler issue under Mac OS X 10.7.
* conntrack plugin: Support zero as legitimate value. Thanks to Louis
Opter for his patch.
* memcached plugin: Increased the size of a static buffer, which was
truncating status messages form memcached. Thanks to Timon for the
patch.
* network plugin: Forwarding of notifications has been disabled. This
was a contition not checked for before, which may retult in an
endless loop.
* processes plugin: Support for process names with spaces has been
added to the Linux implementation. Thanks to Darrell Bishop for his
patch.
* perl plugin: A race condition in several callbacks, including log and
write callbacks, has been fixed. Thanks to "Rrpv" for reporting this
bug.
* snmp plugin: A bug when casting unsigned integers to gauge values has
been fixed: Unsigned integers would be cast to a signed integer and
then to a gauge, possibly resulting in a negative value.
* tcpconns plugin: Compilation with newer versions of the FreeBSD
runtime has been fixed.

2012-02-19, Version 4.10.6
* Build system: Fix problems when building the ipvs and iptables
plugins. Thanks to Sebastian Harl for his patch. A bashism in the
Expand Down
45 changes: 31 additions & 14 deletions configure.in
Expand Up @@ -1423,6 +1423,7 @@ AM_CONDITIONAL(BUILD_WITH_LIBKVM_GETSWAPINFO, test "x$with_kvm_getswapinfo" = "x
AC_CHECK_LIB(kvm, kvm_nlist, [with_kvm_nlist="yes"], [with_kvm_nlist="no"])
if test "x$with_kvm_nlist" = "xyes"
then
AC_CHECK_HEADERS(bsd/nlist.h nlist.h)
AC_DEFINE(HAVE_LIBKVM_NLIST, 1,
[Define to 1 if you have the 'kvm' library with the 'kvm_nlist' symbol (-lkvm)])
with_libkvm="yes"
Expand Down Expand Up @@ -1896,9 +1897,10 @@ then
AC_CHECK_TYPES([iptc_handle_t, ip6tc_handle_t], [], [])
fi
# Check for the iptc_init symbol in the library.
# This could be in iptc or ip4tc
if test "x$with_libiptc" = "xpkgconfig"
then
AC_CHECK_LIB(iptc, iptc_init,
AC_SEARCH_LIBS(iptc_init, [iptc ip4tc],
[with_libiptc="pkgconfig"],
[with_libiptc="no"],
[$with_libiptc_libs])
Expand Down Expand Up @@ -3350,26 +3352,39 @@ AC_ARG_WITH(librabbitmq, [AS_HELP_STRING([--with-librabbitmq@<:@=PREFIX@:>@], [P
[
with_librabbitmq="yes"
])
SAVE_CPPFLAGS="$CPPFLAGS"
SAVE_LDFLAGS="$LDFLAGS"
CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
LDFLAGS="$LDFLAGS $with_librabbitmq_ldflags"
if test "x$with_librabbitmq" = "xyes"
then
SAVE_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"

AC_CHECK_HEADERS(amqp.h, [with_librabbitmq="yes"], [with_librabbitmq="no (amqp.h not found)"])

CPPFLAGS="$SAVE_CPPFLAGS"
fi
if test "x$with_librabbitmq" = "xyes"
then
SAVE_CPPFLAGS="$CPPFLAGS"
SAVE_LDFLAGS="$LDFLAGS"
CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
LDFLAGS="$LDFLAGS $with_librabbitmq_ldflags"

# librabbitmq up to version 0.9.1 provides "library_errno", later
# versions use "library_error". The library does not provide a version
# macro :( Use "AC_CHECK_MEMBERS" (plural) for automatic defines.
AC_CHECK_MEMBERS([amqp_rpc_reply_t.library_errno],,,
[
#if HAVE_STDLIB_H
# include <stdlib.h>
#endif
#if HAVE_STDIO_H
# include <stdio.h>
#endif
#if HAVE_STDINT_H
# include <stdint.h>
#endif
#if HAVE_INTTYPES_H
# include <inttypes.h>
#endif
#include <amqp.h>
])
fi
if test "x$with_librabbitmq" = "xyes"
then
AC_CHECK_LIB(rabbitmq, amqp_basic_publish, [with_librabbitmq="yes"], [with_librabbitmq="no (Symbol 'amqp_basic_publish' not found)"])

CPPFLAGS="$SAVE_CPPFLAGS"
LDFLAGS="$SAVE_LDFLAGS"
fi
if test "x$with_librabbitmq" = "xyes"
then
Expand All @@ -3381,6 +3396,8 @@ then
AC_SUBST(BUILD_WITH_LIBRABBITMQ_LIBS)
AC_DEFINE(HAVE_LIBRABBITMQ, 1, [Define if librabbitmq is present and usable.])
fi
CPPFLAGS="$SAVE_CPPFLAGS"
LDFLAGS="$SAVE_LDFLAGS"
AM_CONDITIONAL(BUILD_WITH_LIBRABBITMQ, test "x$with_librabbitmq" = "xyes")
# }}}

Expand Down
2 changes: 1 addition & 1 deletion src/Makefile.am
Expand Up @@ -82,7 +82,7 @@ endif

if BUILD_WITH_OWN_LIBOCONFIG
collectd_LDADD += $(LIBLTDL) liboconfig/liboconfig.la
collectd_DEPENDENCIES += $(LIBLTDL) liboconfig/liboconfig.la
collectd_DEPENDENCIES += liboconfig/liboconfig.la
else
collectd_LDADD += -loconfig
endif
Expand Down
54 changes: 51 additions & 3 deletions src/amqp.c
@@ -1,7 +1,7 @@
/**
* collectd - src/amqp.c
* Copyright (C) 2009 Sebastien Pahl
* Copyright (C) 2010 Florian Forster
* Copyright (C) 2009 Sebastien Pahl
* Copyright (C) 2010-2012 Florian Forster
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
Expand Down Expand Up @@ -178,8 +178,13 @@ static char *camqp_strerror (camqp_config_t *conf, /* {{{ */
break;

case AMQP_RESPONSE_LIBRARY_EXCEPTION:
#if HAVE_AMQP_RPC_REPLY_T_LIBRARY_ERRNO
if (r.library_errno)
return (sstrerror (r.library_errno, buffer, buffer_size));
#else
if (r.library_error)
return (sstrerror (r.library_error, buffer, buffer_size));
#endif
else
sstrncpy (buffer, "End of stream", sizeof (buffer));
break;
Expand Down Expand Up @@ -216,6 +221,7 @@ static char *camqp_strerror (camqp_config_t *conf, /* {{{ */
return (buffer);
} /* }}} char *camqp_strerror */

#if HAVE_AMQP_RPC_REPLY_T_LIBRARY_ERRNO
static int camqp_create_exchange (camqp_config_t *conf) /* {{{ */
{
amqp_exchange_declare_ok_t *ed_ret;
Expand Down Expand Up @@ -246,6 +252,46 @@ static int camqp_create_exchange (camqp_config_t *conf) /* {{{ */

return (0);
} /* }}} int camqp_create_exchange */
#else
static int camqp_create_exchange (camqp_config_t *conf) /* {{{ */
{
amqp_exchange_declare_ok_t *ed_ret;
amqp_table_t argument_table;
struct amqp_table_entry_t_ argument_table_entries[1];

if (conf->exchange_type == NULL)
return (0);

/* Valid arguments: "auto_delete", "internal" */
argument_table.num_entries = STATIC_ARRAY_SIZE (argument_table_entries);
argument_table.entries = argument_table_entries;
argument_table_entries[0].key = amqp_cstring_bytes ("auto_delete");
argument_table_entries[0].value.kind = AMQP_FIELD_KIND_BOOLEAN;
argument_table_entries[0].value.value.boolean = 1;

ed_ret = amqp_exchange_declare (conf->connection,
/* channel = */ CAMQP_CHANNEL,
/* exchange = */ amqp_cstring_bytes (conf->exchange),
/* type = */ amqp_cstring_bytes (conf->exchange_type),
/* passive = */ 0,
/* durable = */ 0,
/* arguments = */ argument_table);
if ((ed_ret == NULL) && camqp_is_error (conf))
{
char errbuf[1024];
ERROR ("amqp plugin: amqp_exchange_declare failed: %s",
camqp_strerror (conf, errbuf, sizeof (errbuf)));
camqp_close_connection (conf);
return (-1);
}

INFO ("amqp plugin: Successfully created exchange \"%s\" "
"with type \"%s\".",
conf->exchange, conf->exchange_type);

return (0);
} /* }}} int camqp_create_exchange */
#endif

static int camqp_setup_queue (camqp_config_t *conf) /* {{{ */
{
Expand Down Expand Up @@ -316,7 +362,9 @@ static int camqp_setup_queue (camqp_config_t *conf) /* {{{ */
/* consumer_tag = */ AMQP_EMPTY_BYTES,
/* no_local = */ 0,
/* no_ack = */ 1,
/* exclusive = */ 0);
/* exclusive = */ 0,
/* arguments = */ AMQP_EMPTY_TABLE
);
if ((cm_ret == NULL) && camqp_is_error (conf))
{
char errbuf[1024];
Expand Down

0 comments on commit ab55c79

Please sign in to comment.