AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
+AM_PROG_CC_C_O
AM_CONDITIONAL(COMPILER_IS_GCC, test "x$GCC" = "xyes")
dnl configure libtool
[with_libresolv="no"])
AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes")
+dnl Check for HAL (hardware abstraction library)
+with_libhal="yes"
+AC_CHECK_LIB(hal,libhal_device_property_exists,
+ [AC_DEFINE(HAVE_LIBHAL, 1, [Define to 1 if you have 'hal' library])],
+ [with_libhal="no"])
+if test "x$with_libhal" = "xyes"; then
+ PKG_PROG_PKG_CONFIG
+ if test "x$PKG_CONFIG" != "x"; then
+ BUILD_WITH_LIBHAL_CFLAGS="`pkg-config --cflags hal`"
+ BUILD_WITH_LIBHAL_LIBS="`pkg-config --libs hal`"
+ AC_SUBST(BUILD_WITH_LIBHAL_CFLAGS)
+ AC_SUBST(BUILD_WITH_LIBHAL_LIBS)
+ fi
+fi
m4_divert_once([HELP_WITH], [
collectd additional packages:])
[
with_libiokit="yes"
collectd_libiokit=1
- ],
+ ],
[
with_libiokit="no"
collectd_libiokit=0
fi
],
[
- #753
with_liboping="yes"
])
fi
],
[
- if test "x$ac_system" = "xLinux"
+ if test "x$ac_system" = "xLinux"
then
with_libiptc="yes"
else
with_snmp_libs=""
AC_ARG_WITH(libnetsnmp, [AS_HELP_STRING([--with-libnetsnmp@<:@=PREFIX@:>@], [Path to the Net-SNMPD library.])],
[
- if test "x$withval" = "xno"
+ if test "x$withval" = "xno"
then
with_libnetsnmp="no"
else if test "x$withval" = "xyes"
then
with_libnetsnmp="yes"
else
- if test -x "$withval"
+ if test -x "$withval"
then
with_snmp_config="$withval"
with_libnetsnmp="yes"
fi
if test "x$with_libupsclient" = "xyes"
then
- AC_CHECK_TYPES([UPSCONN_t, UPSCONN], [], [],
+ AC_CHECK_TYPES([UPSCONN_t, UPSCONN], [], [],
[#include <stdlib.h>
#include <stdio.h>
#include <upsclient.h>])
fi
AM_CONDITIONAL(BUILD_WITH_LIBNETLINK, test "x$with_libnetlink" = "xyes")
+ dnl Check for libvirt and libxml2 libraries.
+ AC_CHECK_LIB(xml2,xmlXPathEval,
+ [with_libxml2="yes"],
+ [with_libxml2="no"])
+
+ with_libvirt="no"
+ if test "x$with_libxml2" = "xyes"; then
+ AC_CHECK_LIB(virt,virDomainBlockStats,
+ [with_libvirt="yes"],
+ [with_libvirt="no (symbol virDomainBlockStats not found)"])
+ fi
+ dnl Add the right compiler flags and libraries.
+ if test "x$with_libvirt" = "xyes"; then
+ PKG_PROG_PKG_CONFIG
+ if test "x$PKG_CONFIG" != "x"; then
+ BUILD_WITH_LIBVIRTSTATS_CFLAGS="`pkg-config --cflags libvirt` `pkg-config --cflags libxml-2.0`"
+ BUILD_WITH_LIBVIRTSTATS_LIBS="`pkg-config --libs libvirt` `pkg-config --libs libxml-2.0`"
+ AC_SUBST(BUILD_WITH_LIBVIRTSTATS_CFLAGS)
+ AC_SUBST(BUILD_WITH_LIBVIRTSTATS_LIBS)
+ fi
+ fi
+
+ dnl End of check for libvirt and libxml2 libraries.
+
# Check for enabled/disabled features
#
AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters])
AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics])
AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics])
+ AC_PLUGIN([libvirtstats],[$with_libvirt], [Virtual machine statistics])
AC_PLUGIN([load], [$plugin_load], [System load])
AC_PLUGIN([logfile], [yes], [File logging plugin])
AC_PLUGIN([mbmon], [yes], [Query mbmond])
AC_PLUGIN([tcpconns], [$plugin_tcpconns], [TCP connection statistics])
AC_PLUGIN([unixsock], [yes], [Unixsock communication plugin])
AC_PLUGIN([users], [$plugin_users], [User statistics])
+AC_PLUGIN([uuid], [yes], [UUID as hostname plugin])
AC_PLUGIN([vserver], [$plugin_vserver], [Linux VServer statistics])
AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics])
AC_PLUGIN([xmms], [$with_libxmms], [XMMS statistics])
libsensors . . . . $with_lm_sensors
libstatgrab . . . . $with_libstatgrab
libupsclient . . . $with_libupsclient
+ libvirt . . . . . . $with_libvirt
+ libxml2 . . . . . . $with_libxml2
libxmms . . . . . . $with_libxmms
Features:
iptables . . . . . $enable_iptables
ipvs . . . . . . . $enable_ipvs
irq . . . . . . . . $enable_irq
+ libvirtstats . . . $enable_libvirtstats
load . . . . . . . $enable_load
logfile . . . . . . $enable_logfile
mbmon . . . . . . . $enable_mbmon
tcpconns . . . . . $enable_tcpconns
unixsock . . . . . $enable_unixsock
users . . . . . . . $enable_users
+ uuid . . . . . . . $enable_uuid
vserver . . . . . . $enable_vserver
wireless . . . . . $enable_wireless
xmms . . . . . . . $enable_xmms
collectd_DEPENDENCIES += irq.la
endif
+ if BUILD_PLUGIN_LIBVIRTSTATS
+ pkglib_LTLIBRARIES += libvirtstats.la
+ libvirtstats_la_SOURCES = libvirtstats.c
+ libvirtstats_la_CFLAGS = $(BUILD_WITH_LIBVIRTSTATS_CFLAGS)
+ libvirtstats_la_LIBADD = $(BUILD_WITH_LIBVIRTSTATS_LIBS)
+ libvirtstats_la_LDFLAGS = -module -avoid-version
+ collectd_LDADD += "-dlopen" libvirtstats.la
+ collectd_DEPENDENCIES += libvirtstats.la
+ endif
+
if BUILD_PLUGIN_LOAD
pkglib_LTLIBRARIES += load.la
load_la_SOURCES = load.c
collectd_DEPENDENCIES += users.la
endif
+if BUILD_PLUGIN_UUID
+pkglib_LTLIBRARIES += uuid.la
+uuid_la_SOURCES = uuid.c
+uuid_la_CFLAGS = $(BUILD_WITH_LIBHAL_CFLAGS)
+uuid_la_LIBADD = $(BUILD_WITH_LIBHAL_LIBS)
+uuid_la_LDFLAGS = -module -avoid-version
+collectd_LDADD += "-dlopen" uuid.la
+collectd_DEPENDENCIES += uuid.la
+endif
+
if BUILD_PLUGIN_VSERVER
pkglib_LTLIBRARIES += vserver.la
vserver_la_SOURCES = vserver.c
=back
+ =head2 Plugin C<libvirtstats>
+
+ This plugin allows CPU, disk and network load to be monitored for
+ virtualized guests on the machine. The statistics are collected
+ through libvirt (L<http://libvirt.org/>).
+
+ Only I<Connection> is required.
+
+ =over 4
+
+ =item B<Connection> I<uri>
+
+ Connect to the hypervisor given by I<uri>. For example if using
+ Xen use:
+
+ Connection "xen:///"
+
+ Details are URIs allowed are given at L<http://libvirt.org/uri.html>.
+
+ =item B<RefreshInterval> I<seconds>
+
+ Refresh the list of domains and devices every I<seconds>. The default
+ is 60 seconds. Setting this to be the same or smaller than the
+ I<Interval> will cause the list of domains and devices to be refreshed
+ on every iteration.
+
+ Refreshing the devices in particular is quite a costly operation, so
+ if your virtualization setup is static you might consider increasing
+ this.
+
+ =item B<Domain> I<name>
+ =item B<BlockDevice> I<name:dev>
+ =item B<InterfaceDevice> I<name:dev>
+ =item B<IgnoreSelected> I<true>|I<false>
+
+ Select which domains and devices are monitored.
+
+ If I<IgnoreSelected> is not given or I<false> then only the
+ listed domains and disk/network devices are monitored.
+
+ If I<IgnoreSelected> is I<true> then the test is reversed
+ and the listed domains and disk/network devices are ignored,
+ while the rest are monitored.
+
+ The domain name and device names may use a regular expression, if the
+ name is surrounded by I</.../> and collectd was compiled with support
+ for regexps.
+
+ The default is to monitor all domains and all their devices.
+
+ Example:
+
+ BlockDevice "/:hdb/"
+ IgnoreSelected "true"
+
+ Ignore all I<hdb> devices on any domain, but other block devices
+ (eg. I<hda>) will be monitored.
+
+ =back
+
=head2 Plugin C<logfile>
=over 4
=back
+=head2 Plugin C<uuid>
+
+This plugin, if loaded, causes the Hostname to be taken from the
+machine's UUID. The UUID is a universally unique designation for the
+machine, usually taken from the machine's BIOS. This is most useful
+if the machine is running in a virtual environment such as Xen, in
+which case the UUID is preserved across shutdowns and migration.
+
+The following methods are used to find the machine's UUID, in order:
+
+Check I</etc/uuid> (or I<UUIDFile>).
+
+Check for UUID from HAL (L<http://www.freedesktop.org/wiki/Software/hal>)
+if present.
+
+Check for UUID from C<dmidecode> / SMBIOS.
+
+Check for UUID from Xen hypervisor.
+
+If no UUID can be found then the hostname is not modified.
+
+=over 4
+
+=item B<UUIDFile> I<Path>
+
+Take the UUID from the given file (default I</etc/uuid>).
+
+=back
+
=head2 Plugin C<vserver>
This plugin doesn't have any options. B<VServer> support is only available for