* xmms plugin: The new `xmms' plugin graphs the bitrate and frequency
of music played with xmms.
+2007-08-26, Version 4.0.7
+ * documentation: Some typos have been fixed and some information has
+ been improved.
+ * build system: Many fixes for detecting libraries in unusual places,
+ such as on RedHat systems. The affected libraries are `libcurl',
+ `libmysql', and `libupsclient'.
+ * network plugin: Allow the `Port' option to be specified as a number
+ (i. e. without quotes).
+ * nut plugin: A fix allows linking the nut plugin against
+ libupsclient, version >= 2.2.0.
+ * processes plugin: Fix a potential segmentation fault.
+
2007-07-30, Version 4.0.6
* sensors plugin: Fix the ignorelist functionality: Only the `type
instance' was used to match against the list, but the documentation
voltage sensors.
- battery
- Batterycharge, -current and volatage of ACPI and PMU based laptop
+ Batterycharge, -current and voltage of ACPI and PMU based laptop
batteries.
- cpu
- perl
The perl plugin implements a Perl-interpreter into collectd. You can
- write your own plugins in Perl and return arbitary values using this
+ write your own plugins in Perl and return arbitrary values using this
API. See collectd-perl(5).
This plugin is still considered to be experimental and subject to change
Users currently logged in.
- vserver
- System ressources used by Linux VServers.
+ System resources used by Linux VServers.
See <http://linux-vserver.org/>.
- wireless
plugins:
- csv
- Write to comma seperated values (CSV) files. This needs lots of
+ Write to comma separated values (CSV) files. This needs lots of
diskspace but is extremely portable and can be analysed with almost
every program that can analyse anything. Even Microsoft's Excel..
Writes logmessages to a file or STDOUT/STDERR.
- syslog
- Logs to the standard UNIX logging mechanismn, syslog.
+ Logs to the standard UNIX logging mechanism, syslog.
* Performance: Since collectd is running as a daemon it doesn't spend much
time starting up again and again. With the exception of the exec plugin no
and multicore processors and makes sure that the daemon isn't idle if only
one plugins waits for an IO-operation to complete.
- * Once set up, hardly any maintenence is neccessary. Setup is kept as easy
+ * Once set up, hardly any maintenance is necessary. Setup is kept as easy
as possible and the default values should be okay for most users.
* A POSIX-threads (pthread) implementation.
Since gathering some statistics is slow (network connections, slow devices,
- etc) the collectd is parellelized. The POSIX threads interface is being
+ etc) the collectd is parallelized. The POSIX threads interface is being
used and should be found in various implementations for hopefully all
platforms.
* librrd (optional; headers and library; rrdtool 1.0 and 1.2 both work fine)
If built without `librrd' the resulting binary will be `client only', i.e.
will send its values via multicast and not create any RRD files itself.
- Alternatively you can chose to write CSV-files (Comma Seperated Values)
+ Alternatively you can chose to write CSV-files (Comma Separated Values)
instead.
* libsensors (optional)
are likely never passed to the libm you have a good chance to be lucky.
+Contact
+-------
+
+ For questions, bugreports, development information and basically all other
+ concerns please send an email to collectd's mailinglist at
+ <collectd at verplant.org>.
+
+ For live discussion and more personal contact visit us in IRC, we're in
+ channel #collectd on freenode.
+
+
Author
------
Sebastian tokkee Harl <sh at tokkee.org>,
and many contributors (see `AUTHORS').
+ Please send bugreports and patches to the mailinglist, see `Contact' above.
+
### BEGIN of check for libcurl ###
with_curl_config="curl-config"
-with_curl_prefix=0
+with_curl_cflags=""
with_curl_libs=""
AC_ARG_WITH(libcurl, [AS_HELP_STRING([--with-libcurl@<:@=PREFIX@:>@], [Path to libcurl.])],
[
- if test "x$withval" != "xno" -a "x$withval" != "xyes"
- then
- if test -x "$withval/bin/curl-config"
- then
- with_curl_config="$withval/bin/curl-config"
- with_curl_prefix=1
- fi
- fi
if test "x$withval" = "xno"
then
with_libcurl="no"
- else
+ else if test "x$withval" = "xyes"
+ then
with_libcurl="yes"
- fi
+ else
+ if test -x "$withval"
+ then
+ with_curl_config="$withval"
+ else if test -x "$withval/bin/curl-config"
+ then
+ with_curl_config="$withval/bin/curl-config"
+ fi; fi
+ fi; fi
],
[
with_libcurl="yes"
])
if test "x$with_libcurl" = "xyes"
then
- with_curl_libs=`$with_curl_config --libs 2>/dev/null`
+ with_curl_cflags=`$with_curl_config --cflags 2>/dev/null`
curl_config_status=$?
if test $curl_config_status -ne 0
then
with_libcurl="no"
else
- AC_CHECK_LIB(curl, curl_easy_init,
- [
- BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
- AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
- ],
- [
- with_libcurl="no"
- ],
- [$with_curl_libs])
+ SAVE_CFLAGS=$CFLAGS
+ CFLAGS="$CFLAGS $with_curl_cflags"
+
+ AC_CHECK_HEADERS(curl/curl.h, [], [with_libcurl="no (curl/curl.h not found)"], [])
+
+ CFLAGS="$SAVE_CFLAGS"
fi
fi
-if test "x$with_libcurl" = "xyes" -a $with_curl_prefix -ne 0
+if test "x$with_libcurl" = "xyes"
then
- with_curl_prefix=`$with_curl_config --libs 2>/dev/null`
+ with_curl_libs=`$with_curl_config --libs 2>/dev/null`
curl_config_status=$?
if test $curl_config_status -ne 0
then
with_libcurl="no"
else
- if test -d "$with_curl_prefix/include"
- then
- CPPFLAGS="$CPPFLAGS -I$with_curl_prefix/include"
- fi
+ AC_CHECK_LIB(curl, curl_easy_init,
+ [
+ # We need to do this to have `HAVE_LIBCURL' defined but
+ # `-lcurl' NOT added to the default LDFLAGS.
+ AC_DEFINE(HAVE_LIBCURL, 1,
+ [Define to 1 if you have the curl library.])
+ ],
+ [with_libcurl="no (symbol 'curl_easy_init' not found)"],
+ [$with_curl_libs])
fi
fi
-
-with_libcurl_numeric=0
if test "x$with_libcurl" = "xyes"
then
- with_libcurl_numeric=1
+ BUILD_WITH_LIBCURL_CFLAGS="$with_curl_cflags"
+ BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
+ AC_SUBST(BUILD_WITH_LIBCURL_CFLAGS)
+ AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
fi
-AC_DEFINE_UNQUOTED(HAVE_LIBCURL, [$with_libcurl_numeric], [Define to 1 if you have the 'curl' library (-lcurl).])
AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
### END of check for libcurl ###
[Wether or not to use sensors library])
AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_lm_sensors" = "xyes")
+with_mysql_config="mysql_config"
+with_mysql_cflags=""
+with_mysql_libs=""
AC_ARG_WITH(libmysql, [AS_HELP_STRING([--with-libmysql@<:@=PREFIX@:>@], [Path to libmysql.])],
[
- if test "x$withval" != "xno" && test "x$withval" != "xyes"
+ if test "x$withval" = "xno"
+ then
+ with_libmysql="no"
+ else if test "x$withval" = "xyes"
then
- LDFLAGS="$LDFLAGS -L$withval/lib"
- CPPFLAGS="$CPPFLAGS -I$withval/include"
with_libmysql="yes"
- fi
+ else
+ if test -x "$withval";
+ then
+ with_mysql_config="$withval"
+ else if test -x "$withval/bin/mysql_config"
+ then
+ with_mysql_config="$withval/bin/mysql_config"
+ fi; fi
+ fi; fi
],
[
with_libmysql="yes"
])
if test "x$with_libmysql" = "xyes"
then
- AC_CHECK_LIB(mysqlclient, mysql_init,
- [
- AC_DEFINE(HAVE_LIBMYSQLCLIENT, 1, [Define to 1 if you have the mysqlclient library (-lmysqlclient).])
- ], [with_libmysql="no (libmysql not found)"])
+ with_mysql_cflags=`$with_mysql_config --cflags 2>/dev/null`
+ mysql_config_status=$?
+
+ if test $mysql_config_status -ne 0
+ then
+ with_libmysql="no"
+ else
+ SAVE_CFLAGS=$CFLAGS
+ CFLAGS="$CFLAGS $with_mysql_cflags"
+
+ AC_CHECK_HEADERS(mysql/mysql.h, [], [with_libmysql="no (mysql/mysql.h not found)"], [])
+
+ CFLAGS="$SAVE_CFLAGS"
+ fi
fi
if test "x$with_libmysql" = "xyes"
then
- AC_CHECK_HEADERS(mysql/mysql.h,
- [
- AC_DEFINE(HAVE_MYSQL_MYSQL_H, 1, [Define to 1 if you have the <mysql/mysql.h> header file.])
- ], [with_libmysql="no (mysql/mysql.h not found)"])
+ with_mysql_libs=`$with_mysql_config --libs 2>/dev/null`
+ mysql_config_status=$?
+
+ if test $mysql_config_status -ne 0
+ then
+ with_libmysql="no"
+ else
+ AC_CHECK_LIB(mysqlclient, mysql_init,
+ [
+ # We need to do this to have `HAVE_LIBMYSQLCLIENT' defined
+ # but `-lmysqlclient' NOT added to the default LDFLAGS.
+ AC_DEFINE(HAVE_LIBMYSQLCLIENT, 1,
+ [Define to 1 if you have the mysqlclient library.])
+ ],
+ [with_libmysql="no (libmysql not found)"],
+ [$with_mysql_libs])
+ fi
fi
if test "x$with_libmysql" = "xyes"
then
- collect_libmysql=1
-else
- collect_libmysql=0
+ BUILD_WITH_LIBMYSQL_CFLAGS="$with_mysql_cflags"
+ BUILD_WITH_LIBMYSQL_LIBS="$with_mysql_libs"
+ AC_SUBST(BUILD_WITH_LIBMYSQL_CFLAGS)
+ AC_SUBST(BUILD_WITH_LIBMYSQL_LIBS)
fi
-AC_DEFINE_UNQUOTED(COLLECT_LIBMYSQL, [$collect_libmysql],
- [Wether or not to use mysql library])
AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes")
with_own_liboconfig="no"
then
AC_DEFINE(HAVE_LIBUPSCLIENT, 1, [Define to 1 if you have the upsclient library (-lupsclient).])
fi
+if test "x$with_libupsclient" = "xyes"
+then
+ AC_CHECK_TYPES([UPSCONN_t, UPSCONN], [], [],
+[#include <stdlib.h>
+#include <stdio.h>
+#include <upsclient.h>])
+fi
AM_CONDITIONAL(BUILD_WITH_LIBUPSCLIENT, test "x$with_libupsclient" = "xyes")
### BEGIN of check for libxmms ###
Exporter::export_ok_tags('all');
-bootstrap Collectd "4.0.6";
+bootstrap Collectd "4.0.7";
1;
The files in this directory may be used to perform common tasks that aren't
-exactly `collectd's job. They may or may not require in-depth knowlege of RRD
+exactly `collectd's job. They may or may not require in-depth knowledge of RRD
files and/or `collectd's inner workings. Use at your own risk.
PerlLib/
add_rra.sh
----------
Before version 3.9.0 collectd used to create a different set of RRAs. The
-most detailed of these old RRAs hat a one minute resolution. This script can
+most detailed of these old RRAs had a one minute resolution. This script can
be used to add three more RRAs: minimum, maximum and average with a ten second
-resolution and 2200 rows (~6 hours). This will make houly statistics much more
+resolution and 2200 rows (~6 hours). This will make hourly statistics much more
interesting. Please note that no sanity- checking whatsoever is performed. You
can seriously fuck up your RRD files if you don't know what you're doing.
use strict;
use Fatal qw(open close);
use File::Basename;
+use Getopt::Long qw(:config no_ignore_case bundling pass_through);
+
+my $DIR = "/var/lib/collectd";
+my $HOST = "_UNDEFINED_";
+
+GetOptions (
+ "host-is=s" => \$HOST,
+ "data-dir=s" => \$DIR
+);
-my $DIR = "/var/lib/collectd";
my @COLORS = (0xff7777, 0x7777ff, 0x55ff55, 0xffcc77, 0xff77ff, 0x77ffff,
0xffff77, 0x55aaff);
my @tmp = `/bin/hostname`; chomp(@tmp);
-my $HOST = $tmp[0];
+$HOST = $tmp[0] if ( $HOST =~ /_UNDEFINED_/ );
my $IMG_DIR = "${HOST}.dir";
my $HTML = "${HOST}.html";
if BUILD_PLUGIN_APACHE
pkglib_LTLIBRARIES += apache.la
apache_la_SOURCES = apache.c
-apache_la_LDFLAGS = -module -avoid-version $(BUILD_WITH_LIBCURL_LIBS)
+apache_la_LDFLAGS = -module -avoid-version
+apache_la_CFLAGS =
+apache_la_LIBADD =
collectd_LDADD += "-dlopen" apache.la
+if BUILD_WITH_LIBCURL
+apache_la_CFLAGS += $(BUILD_WITH_LIBCURL_CFLAGS)
+apache_la_LIBADD += $(BUILD_WITH_LIBCURL_LIBS)
+endif
collectd_DEPENDENCIES += apache.la
endif
if BUILD_PLUGIN_MYSQL
pkglib_LTLIBRARIES += mysql.la
mysql_la_SOURCES = mysql.c
-mysql_la_LDFLAGS = -module -avoid-version -lmysqlclient
+mysql_la_LDFLAGS = -module -avoid-version
+mysql_la_CFLAGS =
+mysql_la_LIBADD =
collectd_LDADD += "-dlopen" mysql.la
+if BUILD_WITH_LIBMYSQL
+mysql_la_CFLAGS += $(BUILD_WITH_LIBMYSQL_CFLAGS)
+mysql_la_LIBADD += $(BUILD_WITH_LIBMYSQL_LIBS)
+endif
collectd_DEPENDENCIES += mysql.la
endif
=item B<-g> B<none>I<|>B<average>I<|>B<sum>
When multiple data sources are selected from a value spec they can be handled
-differently dependin on this option. The values of the following meaning:
+differently depending on this option. The values of the following meaning:
=over 4
message to STDOUT and signals success or failure with it's return value. It
exists with a return value of B<0> for success or B<1> or B<2> for warning and
critical, respectively. If the values is not available or some other error
-occured it returnes B<3> for "unknown".
+occurred it returns B<3> for "unknown".
=head1 SEE ALSO
The C<perl plugin> includes a Perl-interpreter in collectd and provides
Perl-equivalents of the plugin-functions. This makes it possible to write
-plugins for collectd in Perl. This is a lot more performant than executing a
+plugins for collectd in Perl. This is a lot more efficient than executing a
Perl-script every time you want to read a value with the C<exec plugin> (see
L<collectd-exec(5)>) and provides a lot more functionality, too.
=item B<GETVAL> I<Identifier>
If the value identified by I<Identifier> (see below) is found the complete
-value-list is returned. The response is a space seperated list of
+value-list is returned. The response is a space separated list of
name-value-pairs:
I<num> I<name>B<=>I<value>[ I<name>B<=>I<value>[ ...]]
-If I<num> is less then zero, an error occured. Otherwise it contains the
+If I<num> is less then zero, an error occurred. Otherwise it contains the
number of values that follow. Each value is of the form I<name>B<=>I<value>.
Counter-values are converted to a rate, e.E<nbsp>g. bytes per second.
Undefined values are returned as B<NaN>.
=head2 Identifiers
-Value or value-lists are identified in a uniform fassion:
+Value or value-lists are identified in a uniform fashion:
I<Hostname>/I<Plugin>/I<Type>
behavior.
The syntax of this config file is similar to the config file of the famos
-B<Apache Webserver>. Each line containes either a key-value-pair or a
+B<Apache Webserver>. Each line contains either a key-value-pair or a
section-start or -end. Empty lines and everything after the hash-symbol `#' is
ignored. Values are either string, enclosed in double-quotes,
-(floating-point-)numbers or a boolean extression, i.E<nbsp>e. either B<true> or
+(floating-point-)numbers or a boolean expression, i.E<nbsp>e. either B<true> or
B<false>. String containing of only alphanumeric characters and underscores do
not need to be quoted.
=head1 PLUGIN OPTIONS
-Some Plugins may register own options. These options must be inclosed in a
+Some Plugins may register own options. These options must be enclosed in a
C<Plugin>-Section. Which options exist depends on the plugin used. Some plugins
require external configuration, too. The C<apache plugin>, for example,
required C<mod_status> to be configured in the webserver you're going to
=item B<CACert> I<File>
File that holds one or more SSL certificates. If you want to use HTTPS you will
-possibly need this option. What CA certificates come bundeled with C<libcurl>
+possibly need this option. What CA certificates come bundled with C<libcurl>
and are checked by default depends on the distribution you use.
=back
Invert the selection: If set to true, all partitions B<except> the ones that
match any one of the criteria are collected. By default only selected
-partitions are collected if a selection is made. If no selection is conifured
+partitions are collected if a selection is made. If no selection is configured
at all, B<all> partitions are selected.
=back
=head2 Plugin C<exec>
Please make sure to read L<collectd-exec(5)> before using this plugin. It
-contains valueable information on when the executable is executed and the
+contains valuable information on when the executable is executed and the
output that is expected from it.
=over 4
If no configuration if given, the B<traffic>-plugin will collect data from
all interfaces. This may not be practical, especially for loopback- and
similar interfaces. Thus, you can use the B<Interface>-option to pick the
-interfaces you're interested in. Sometimes, however, it's easier/prefered
+interfaces you're interested in. Sometimes, however, it's easier/preferred
to collect all interfaces I<except> a few ones. This option enables you to
do that: By setting B<IgnoreSelected> to I<true> the effect of
B<Interface> is inversed: All selected interfaces are ignored and all
If no configuration if given, the B<irq>-plugin will collect data from all
irqs. This may not be practical, especially if no interrupts happen. Thus, you
-can use the B<Irq>-option to pick the interupt you're interested in.
-Sometimes, however, it's easier/prefered to collect all interupts I<except> a
+can use the B<Irq>-option to pick the interrupt you're interested in.
+Sometimes, however, it's easier/preferred to collect all interrupts I<except> a
few ones. This option enables you to do that: By setting B<IgnoreSelected> to
-I<true> the effect of B<Irq> is inversed: All selected interupts are ignored
-and all other interupts are collected.
+I<true> the effect of B<Irq> is inversed: All selected interrupts are ignored
+and all other interrupts are collected.
=back
=item B<Database> I<Database>
-Select this database. Defaults to I<no database> which is a perfecly reasonable
+Select this database. Defaults to I<no database> which is a perfectly reasonable
option for what this plugin does.
=back
If no B<Listen> statement is found the server tries join both, the default IPv6
multicast group and the default IPv4 multicast group. If no B<Server> statement
is found the client will try to send data to the IPv6 multicast group first. If
-that failes the client will try the IPv4 multicast group.
+that fails the client will try the IPv4 multicast group.
The default IPv6 multicast group is C<ff18::efc0:4a42>. The default IPv4
multicast group is C<239.192.74.66>.
The optional I<Port> argument sets the port to use. It can either be given
-using a numeric port number or a service name. If the argument is omited the
+using a numeric port number or a service name. If the argument is omitted the
default port B<25826> is assumed.
=item B<TimeToLive> I<1-255>
the sending sockets. This should only be activated when the B<Listen>- and
B<Server>-statements differ. Otherwise packets may be send multiple times to
the same multicast group. While this results in more network traffic than
-neccessary it's not a huge problem since the plugin has a duplicate detection,
+necessary it's not a huge problem since the plugin has a duplicate detection,
so the values will not loop.
=item B<CacheFlush> I<Seconds>
You can use the settings B<StepSize>, B<HeartBeat>, B<RRARows>, and B<XFF> to
finetune your RRD-files. Please read L<rrdcreate(1)> if you encounter problems
using these settings. If you don't want to dive into the depths of RRDTool, you
-can savely ignore these settings.
+can safely ignore these settings.
=over 4
=item B<RRATimespan> I<Seconds>
-Adds an RRA-timespan, given in seconds. Use this option mulitple times to have
+Adds an RRA-timespan, given in seconds. Use this option multiple times to have
more then one RRA. If this option is never used, the built-in default of (3600,
86400, 604800, 2678400, 31622400) is used.
If no configuration if given, the B<sensors>-plugin will collect data from all
sensors. This may not be practical, especially for uninteresting sensors.
Thus, you can use the B<Sensor>-option to pick the sensors you're interested
-in. Sometimes, however, it's easier/prefered to collect all sensors I<except> a
+in. Sometimes, however, it's easier/preferred to collect all sensors I<except> a
few ones. This option enables you to do that: By setting B<IgnoreSelected> to
I<true> the effect of B<Sensor> is inversed: All selected sensors are ignored
and all other sensors are collected.
Don't fork to the background. I<collectd> will also B<not> close standard file
descriptors, detach from the session nor write a pid file. This is mainly
-thought for 'supervisioning' init replacements such as I<runit>.
+thought for 'supervising' init replacements such as I<runit>.
=item B<-h>
=item
-Input plugins are queried periodically. They somehow aquire the current value
+Input plugins are queried periodically. They somehow acquire the current value
of whatever they where designed to work with and submit these values back to
the daemon, i. e. they "dispatch" the values. As an example, the C<cpu plugin>
reads the current cpu-counters of time spent in the various modes (user,
&& (fields_num != 2))
return (1);
else if (fields_num == 2)
+ {
+ if ((service = strchr (fields[1], '.')) != NULL)
+ *service = '\0';
service = fields[1];
+ }
node = fields[0];
if (strcasecmp ("Listen", key) == 0)
#include <pthread.h>
#include <upsclient.h>
+#if HAVE_UPSCONN_T
+typedef UPSCONN_t collectd_upsconn_t;
+#elif HAVE_UPSCONN
+typedef UPSCONN collectd_upsconn_t;
+#else
+# error "Unable to determine the UPS connection type."
+#endif
+
struct nut_ups_s;
typedef struct nut_ups_s nut_ups_t;
struct nut_ups_s
{
- UPSCONN *conn;
+ collectd_upsconn_t *conn;
char *upsname;
char *hostname;
int port;
/* (Re-)Connect if we have no connection */
if (ups->conn == NULL)
{
- ups->conn = (UPSCONN *) malloc (sizeof (UPSCONN));
+ ups->conn = (collectd_upsconn_t *) malloc (sizeof (collectd_upsconn_t));
if (ups->conn == NULL)
{
ERROR ("nut plugin: malloc failed.");
closedir (dh);
+ if (list_len == 0)
+ return (NULL);
+
assert (list_len < list_size);
assert (list[list_len] == 0);
return (list);
-}
+} /* int *ps_read_tasks */
int ps_read_process (int pid, procstat_t *ps, char *state)
{