From: Florian Forster Date: Thu, 16 Oct 2008 20:14:28 +0000 (+0200) Subject: Merge branch 'collectd-4.5' X-Git-Tag: collectd-4.6.0~175 X-Git-Url: https://git.octo.it/?p=collectd.git;a=commitdiff_plain;h=568420ac172981edccb8587cc9651952fe350365;hp=fe86778a8eea71062db899f9f7d6f7f79817067d Merge branch 'collectd-4.5' --- diff --git a/ChangeLog b/ChangeLog index 00a04add..474f56fd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -29,6 +29,29 @@ * thermal plugin: The new thermal plugin collects system temperatures using Linux ACPI thermal zone data. +2008-10-16, Version 4.4.4 + * build system: Change `--enable-' to abort with an error if + dependencies are not met. Thanks to Bruno Prémont for the patch. + Also, the poisoning of various string functions has been restricted + to debug builds. + * collectd: Fix a memory leak in the global value cache. With every + *missing* value a couple of bytes would be leaked. Another memory + leak in the configuration handling code has been fixed. Thanks to + Niraj Tolia for reporting these issues. + * collectd: Fix an off-by-one error in the ignorelist functionality. + When using regular expressions, the last character would be missing, + possibly matching differently from what one would expect. + * 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. + * 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 + problems with some `libc's. Thanks to Matthias Lay for reporting the + bug. + 2008-09-01, Version 4.4.3 * collectd: Fix a memory leak in the threshold checking code. * memcached plugin: Fix a too short timeout and a related file diff --git a/contrib/collection.cgi b/contrib/collection.cgi index fb4947dc..7de8bcc8 100755 --- a/contrib/collection.cgi +++ b/contrib/collection.cgi @@ -1016,6 +1016,18 @@ sub load_graph_definitions 'GPRINT:max:MAX:%5.1lf%sAh Max,', 'GPRINT:avg:LAST:%5.1lf%sAh Last\l' ], + connections => ['-v', 'Connections', + 'DEF:avg={file}:value:AVERAGE', + 'DEF:min={file}:value:MIN', + 'DEF:max={file}:value:MAX', + "AREA:max#$HalfBlue", + "AREA:min#$Canvas", + "LINE1:avg#$FullBlue:Connections", + 'GPRINT:min:MIN:%4.1lf Min,', + 'GPRINT:avg:AVERAGE:%4.1lf Avg,', + 'GPRINT:max:MAX:%4.1lf Max,', + 'GPRINT:avg:LAST:%4.1lf Last\l' + ], cpu => ['-v', 'CPU load', 'DEF:avg={file}:value:AVERAGE', 'DEF:min={file}:value:MIN', diff --git a/contrib/exec-munin.px b/contrib/exec-munin.px index 24609564..223a8a5e 100755 --- a/contrib/exec-munin.px +++ b/contrib/exec-munin.px @@ -30,8 +30,7 @@ our $Interval = 300; main (); exit (0); -# Configuration -# {{{ +# Configuration {{{ =head1 CONFIGURATION diff --git a/src/Makefile.am b/src/Makefile.am index b9b7ab89..b20d7009 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -133,7 +133,7 @@ ascent_la_LDFLAGS = -module -avoid-version ascent_la_CFLAGS = $(AM_CFLAGS) \ $(BUILD_WITH_LIBCURL_CFLAGS) $(BUILD_WITH_LIBXML2_CFLAGS) ascent_la_LIBADD = $(BUILD_WITH_LIBCURL_LIBS) $(BUILD_WITH_LIBXML2_LIBS) -collectd_LDADD += "-dlopen" apache.la +collectd_LDADD += "-dlopen" ascent.la collectd_DEPENDENCIES += ascent.la endif @@ -839,5 +839,6 @@ install-exec-hook: $(INSTALL) -m 0640 collectd.conf $(DESTDIR)$(sysconfdir)/collectd.conf; \ fi; \ cp -f $(srcdir)/types.db $(DESTDIR)$(pkglibdir)/; - $(INSTALL) -D -m 0644 $(srcdir)/postgresql_default.conf \ + $(mkinstalldirs) $(DESTDIR)$(pkgdatadir) + $(INSTALL) -m 0644 $(srcdir)/postgresql_default.conf \ $(DESTDIR)$(pkgdatadir)/postgresql_default.conf; diff --git a/src/collectd.conf.in b/src/collectd.conf.in index 53abd3fa..0597273f 100644 --- a/src/collectd.conf.in +++ b/src/collectd.conf.in @@ -284,6 +284,11 @@ FQDNLookup true # BaseName "Collectd::Plugin" # EnableDebugger "" # LoadPlugin foo +# +# +# Foo "Bar" +# Qux "Baz" +# # # diff --git a/src/collectd.h b/src/collectd.h index 196530fb..6fed9002 100644 --- a/src/collectd.h +++ b/src/collectd.h @@ -254,7 +254,7 @@ # define __attribute__(x) /**/ #endif -#if __GNUC__ +#if defined(COLLECT_DEBUG) && COLLECT_DEBUG && defined(__GNUC__) && __GNUC__ # pragma GCC poison strcpy strcat strtok #endif @@ -265,7 +265,7 @@ * included. */ #ifndef DONT_POISON_SPRINTF_YET -# if __GNUC__ +# if defined(COLLECT_DEBUG) && COLLECT_DEBUG && defined(__GNUC__) && __GNUC__ # pragma GCC poison sprintf # endif #endif diff --git a/src/perl.c b/src/perl.c index d3e8c29e..d9e1e00f 100644 --- a/src/perl.c +++ b/src/perl.c @@ -36,7 +36,7 @@ #include #include -#if __GNUC__ +#if defined(COLLECT_DEBUG) && COLLECT_DEBUG && defined(__GNUC__) && __GNUC__ # pragma GCC poison sprintf #endif diff --git a/src/postgresql.c b/src/postgresql.c index 43f5af56..a5bacf49 100644 --- a/src/postgresql.c +++ b/src/postgresql.c @@ -243,6 +243,7 @@ static c_psql_database_t *c_psql_database_new (const char *name) static void c_psql_database_delete (c_psql_database_t *db) { PQfinish (db->conn); + db->conn = NULL; sfree (db->queries); db->queries_num = 0; @@ -416,14 +417,17 @@ static int c_psql_exec_query (c_psql_database_t *db, int idx) } rows = PQntuples (res); - if (1 > rows) + if (1 > rows) { + PQclear (res); return 0; + } cols = PQnfields (res); if (query->cols_num != cols) { log_err ("SQL query returned wrong number of fields " "(expected: %i, got: %i)", query->cols_num, cols); log_info ("SQL query was: %s", query->query); + PQclear (res); return -1; } @@ -441,6 +445,7 @@ static int c_psql_exec_query (c_psql_database_t *db, int idx) submit_gauge (db, col.type, col.type_instance, value); } } + PQclear (res); return 0; } /* c_psql_exec_query */ @@ -545,6 +550,12 @@ static int c_psql_init (void) int j; + /* this will happen during reinitialization */ + if (NULL != db->conn) { + c_psql_check_connection (db); + continue; + } + status = ssnprintf (buf, buf_len, "dbname = '%s'", db->database); if (0 < status) { buf += status; diff --git a/src/types.db b/src/types.db index 21d15d64..67d8f0d3 100644 --- a/src/types.db +++ b/src/types.db @@ -86,6 +86,7 @@ serial_octets rx:COUNTER:0:4294967295, tx:COUNTER:0:4294967295 signal_noise value:GAUGE:U:0 signal_power value:GAUGE:U:0 signal_quality value:GAUGE:0:U +spam_check value:GAUGE:0:U spam_score value:GAUGE:U:U swap value:GAUGE:0:1099511627776 tcp_connections value:GAUGE:0:4294967295 diff --git a/src/utils_tail.c b/src/utils_tail.c index eaf8f738..904a5212 100644 --- a/src/utils_tail.c +++ b/src/utils_tail.c @@ -162,6 +162,7 @@ int cu_tail_readline (cu_tail_t *obj, char *buf, int buflen) /* Try to read from the filehandle. If that succeeds, everything appears to * be fine and we can return. */ + clearerr (obj->fh); if (fgets (buf, buflen, obj->fh) != NULL) { buf[buflen - 1] = 0;