From: Florian Forster Date: Sat, 8 Nov 2008 08:00:00 +0000 (+0100) Subject: Merge branch 'collectd-4.5' X-Git-Tag: collectd-4.6.0~163 X-Git-Url: https://git.octo.it/?p=collectd.git;a=commitdiff_plain;h=576d966de9a98aacd1a2740abb349022cc32d913;hp=60a77a6f3855f181e723aa3f4f645ea480ddd359 Merge branch 'collectd-4.5' --- diff --git a/ChangeLog b/ChangeLog index 26dbfd49..74a06cbe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,7 +13,7 @@ * collectdmon: Don't block SIGCHLD. This fixes a potential portability problem. * collectd-nagios: Fix handling of the `-d' option. Thanks to Fabian - Linzberger for reporting the but. + Linzberger for reporting the bug. * iptables plugin: Fix an off-by-one error. If a string was just one character too long, it was truncated instead of reporting an error. * network plugin: Fix a memory leak in the configuration handling @@ -25,7 +25,7 @@ leaks. Thanks to ``Admin'' for reporting these bugs. * snmp plugin: Don't expect null-terminated strings from the Net-SNMP library. - * tail plugin: Call `clearerr' after reading an EOF. This fixes + * tail plugin: Call `clearerr(3)' after reading an EOF. This fixes problems with some `libc's. Thanks to Matthias Lay for reporting the bug. @@ -75,11 +75,11 @@ * collectdmon: Don't block SIGCHLD. This fixes a potential portability problem. * collectd-nagios: Fix handling of the `-d' option. Thanks to Fabian - Linzberger for reporting the but. + Linzberger for reporting the bug. * network plugin: Fix a memory leak in the configuration handling code. Thanks to Niraj Tolia for reporting this issue. * perl plugin: Log an error message if bootstrapping `Collectd' fails. - * tail plugin: Call `clearerr' after reading an EOF. This fixes + * tail plugin: Call `clearerr(3)' after reading an EOF. This fixes problems with some `libc's. Thanks to Matthias Lay for reporting the bug. diff --git a/configure.in b/configure.in index 6eb2cc67..21af0b54 100644 --- a/configure.in +++ b/configure.in @@ -1246,12 +1246,24 @@ then if test $mysql_config_status -ne 0 then - with_libmysql="no" + with_libmysql="no ($with_mysql_config failed)" else SAVE_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $with_mysql_cflags" - AC_CHECK_HEADERS(mysql/mysql.h, [], [with_libmysql="no (mysql/mysql.h not found)"], []) + have_mysql_h="no" + have_mysql_mysql_h="no" + AC_CHECK_HEADERS(mysql.h, [have_mysql_h="yes"]) + + if test "x$have_mysql_h" = "xno" + then + AC_CHECK_HEADERS(mysql/mysql.h, [have_mysql_mysql_h="yes"]) + fi + + if test "x$have_mysql_h$have_mysql_mysql_h" = "xnono" + then + with_libmysql="no (mysql.h not found)" + fi CPPFLAGS="$SAVE_CPPFLAGS" fi @@ -1263,7 +1275,7 @@ then if test $mysql_config_status -ne 0 then - with_libmysql="no" + with_libmysql="no ($with_mysql_config failed)" else AC_CHECK_LIB(mysqlclient, mysql_init, [with_libmysql="yes"], diff --git a/contrib/collection3/bin/graph.cgi b/contrib/collection3/bin/graph.cgi index 1524a660..7fe20871 100755 --- a/contrib/collection3/bin/graph.cgi +++ b/contrib/collection3/bin/graph.cgi @@ -20,6 +20,23 @@ our $Debug = param ('debug'); our $Begin = param ('begin'); our $End = param ('end'); our $GraphWidth = param ('width'); +our $OutputFormat = 'PNG'; +our $ContentType = 'image/png'; + +if (param ('format')) +{ + my $temp = param ('format') || ''; + $temp = uc ($temp); + + if ($temp =~ m/^(PNG|SVG|EPS|PDF)$/) + { + $OutputFormat = $temp; + + if ($OutputFormat eq 'SVG') { $ContentType = 'image/svg+xml'; } + elsif ($OutputFormat eq 'EPS') { $ContentType = 'image/eps'; } + elsif ($OutputFormat eq 'PDF') { $ContentType = 'application/pdf'; } + } +} if ($Debug) { @@ -141,7 +158,7 @@ flush_files ($files, addr => gc_get_scalar ('UnixSockAddr', undef), interval => gc_get_scalar ('Interval', 10)); -print STDOUT header (-Content_type => 'image/png', +print STDOUT header (-Content_type => $ContentType, -Last_Modified => epoch_to_rfc1123 ($obj->getLastModified ()), -Expires => epoch_to_rfc1123 ($expires)); @@ -173,7 +190,7 @@ else } $| = 1; - RRDs::graph ('-', '-a', 'PNG', '--width', $GraphWidth, @timesel, @$args); + RRDs::graph ('-', '-a', $OutputFormat, '--width', $GraphWidth, @timesel, @$args); if (my $err = RRDs::error ()) { print STDERR "RRDs::graph failed: $err\n"; diff --git a/src/Makefile.am b/src/Makefile.am index cd50eea1..cf89c9a1 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -352,7 +352,7 @@ endif if BUILD_PLUGIN_IPVS pkglib_LTLIBRARIES += ipvs.la ipvs_la_SOURCES = ipvs.c -ipvs_la_CFLAGS = $(KERNEL_CFLAGS) +ipvs_la_CFLAGS = $(AM_CFLAGS) $(KERNEL_CFLAGS) ipvs_la_LDFLAGS = -module -avoid-version collectd_LDADD += "-dlopen" ipvs.la collectd_DEPENDENCIES += ipvs.la @@ -789,7 +789,7 @@ endif if BUILD_PLUGIN_UUID pkglib_LTLIBRARIES += uuid.la uuid_la_SOURCES = uuid.c -uuid_la_CFLAGS = $(BUILD_WITH_LIBHAL_CFLAGS) +uuid_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBHAL_CFLAGS) uuid_la_LIBADD = $(BUILD_WITH_LIBHAL_LIBS) uuid_la_LDFLAGS = -module -avoid-version collectd_LDADD += "-dlopen" uuid.la diff --git a/src/apcups.c b/src/apcups.c index 227c703c..ca026b96 100644 --- a/src/apcups.c +++ b/src/apcups.c @@ -24,13 +24,6 @@ * Anthony Gialluca **/ -/* - * FIXME: Don't know why but without this here atof() was not returning - * correct values for me. This is behavior that I don't understand and - * should be examined in closer detail. - */ -#include - #include "collectd.h" #include "common.h" /* rrd_update_file */ #include "plugin.h" /* plugin_register, plugin_submit */ diff --git a/src/configfile.c b/src/configfile.c index 9609086f..b1030fe9 100644 --- a/src/configfile.c +++ b/src/configfile.c @@ -276,7 +276,7 @@ static int dispatch_value_plugin (const char *plugin, oconfig_item_t *ci) buffer_ptr = buffer + 1; return (cf_dispatch (plugin, ci->key, buffer_ptr)); -} /* int plugin_conf_dispatch */ +} /* int dispatch_value_plugin */ static int dispatch_value (const oconfig_item_t *ci) { diff --git a/src/filecount.c b/src/filecount.c index 3e6e6465..e2b00207 100644 --- a/src/filecount.c +++ b/src/filecount.c @@ -398,7 +398,7 @@ static int fc_config_add_dir (oconfig_item_t *ci) fc_directory_conf_t **temp; temp = (fc_directory_conf_t **) realloc (directories, - sizeof (*directories) * directories_num); + sizeof (*directories) * (directories_num + 1)); if (temp == NULL) { ERROR ("filecount plugin: realloc failed."); diff --git a/src/libiptc/Makefile.am b/src/libiptc/Makefile.am index 3a6ef675..a8ed93cc 100644 --- a/src/libiptc/Makefile.am +++ b/src/libiptc/Makefile.am @@ -10,5 +10,6 @@ noinst_LTLIBRARIES = libiptc.la libiptc_la_CFLAGS = -I$(KERNEL_DIR)/include libiptc_la_SOURCES = libip4tc.c libip6tc.c \ - ipt_kernel_headers.h libip6tc.h libiptc.h linux_list.h + ipt_kernel_headers.h libip6tc.h libiptc.h linux_list.h \ + xtables.h libxtc.h diff --git a/src/mysql.c b/src/mysql.c index 312a819e..4e72b5bf 100644 --- a/src/mysql.c +++ b/src/mysql.c @@ -24,7 +24,9 @@ #include "plugin.h" #include "configfile.h" -#ifdef HAVE_MYSQL_MYSQL_H +#ifdef HAVE_MYSQL_H +#include +#elif defined(HAVE_MYSQL_MYSQL_H) #include #endif diff --git a/src/perl.c b/src/perl.c index d9e1e00f..cdfb8d5e 100644 --- a/src/perl.c +++ b/src/perl.c @@ -1790,7 +1790,7 @@ static int perl_config (oconfig_item_t *ci) for (i = 0; i < ci->children_num; ++i) { oconfig_item_t *c = ci->children + i; - int current_status; + int current_status = 0; if (NULL != perl_threads) aTHX = PERL_GET_CONTEXT; diff --git a/src/utils_complain.c b/src/utils_complain.c index 118245cc..d5c09964 100644 --- a/src/utils_complain.c +++ b/src/utils_complain.c @@ -21,6 +21,7 @@ * Sebastian tokkee Harl **/ +#include "collectd.h" #include "utils_complain.h" #include "plugin.h" diff --git a/src/utils_dns.c b/src/utils_dns.c index f2ab3377..c16ca52c 100644 --- a/src/utils_dns.c +++ b/src/utils_dns.c @@ -391,7 +391,7 @@ handle_dns(const char *buf, int len, while ((t = strchr(qh.qname, '\r'))) *t = ' '; for (t = qh.qname; *t; t++) - *t = tolower(*t); + *t = tolower((int) *t); memcpy(&us, buf + offset, 2); qh.qtype = ntohs(us);