* 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";
* 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)
{
#include "libiptc.c"
#define BIT6(a, l) \
- ((ntohl(a->in6_u.u6_addr32[(l) / 32]) >> (31 - ((l) & 31))) & 1)
+ ((ntohl(a->s6_addr32[(l) / 32]) >> (31 - ((l) & 31))) & 1)
int
ipv6_prefix_length(const struct in6_addr *a)
#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
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);