* 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
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.
* 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.
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
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"],
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)
{
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));
}
$| = 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";
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
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
* Anthony Gialluca <tonyabg at charter.net>
**/
-/*
- * 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 <stdlib.h>
-
#include "collectd.h"
#include "common.h" /* rrd_update_file */
#include "plugin.h" /* plugin_register, plugin_submit */
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)
{
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.");
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
#include "plugin.h"
#include "configfile.h"
-#ifdef HAVE_MYSQL_MYSQL_H
+#ifdef HAVE_MYSQL_H
+#include <mysql.h>
+#elif defined(HAVE_MYSQL_MYSQL_H)
#include <mysql/mysql.h>
#endif
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;
* Sebastian tokkee Harl <sh at tokkee.org>
**/
+#include "collectd.h"
#include "utils_complain.h"
#include "plugin.h"
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);
int argc, const char **argv)
{
int status;
+ char *filename_copy;
+
+ if ((filename == NULL) || (argv == NULL))
+ return (-EINVAL);
+
+ /* Some versions of librrd don't have the `const' qualifier for the first
+ * argument, so we have to copy the pointer here to avoid warnings. It sucks,
+ * but what else can we do? :( -octo */
+ filename_copy = strdup (filename);
+ if (filename_copy == NULL)
+ {
+ ERROR ("srrd_create: strdup failed.");
+ return (-ENOMEM);
+ }
optind = 0; /* bug in librrd? */
rrd_clear_error ();
- status = rrd_create_r (filename, pdp_step, last_up, argc, (void *) argv);
+ status = rrd_create_r (filename_copy, pdp_step, last_up,
+ argc, (void *) argv);
if (status != 0)
{
filename, rrd_get_error ());
}
+ sfree (filename_copy);
+
return (status);
} /* }}} int srrd_create */
/* #endif HAVE_THREADSAFE_LIBRRD */