Merge branch 'master' into collectd-4
authorFlorian Forster <octo@leeloo.lan.home.verplant.org>
Thu, 15 Mar 2007 17:33:12 +0000 (18:33 +0100)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Thu, 15 Mar 2007 17:33:12 +0000 (18:33 +0100)
Conflicts:

configure.in

1  2 
configure.in
src/Makefile.am
src/collectd.conf.in
src/collectd.conf.pod

diff --combined configure.in
@@@ -24,8 -24,7 +24,8 @@@ AC_SUBST(LTDLINCL
  AC_SUBST(LIBLTDL)
  AC_LIBTOOL_DLOPEN
  AC_PROG_LIBTOOL
 -#AC_PROG_RANLIB
 +AC_PROG_LEX
 +AC_PROG_YACC
  AC_CONFIG_SUBDIRS(libltdl)
  
  #
@@@ -45,7 -44,7 +45,7 @@@ AC_CHECK_HEADERS(assert.h
  AC_CHECK_HEADERS(sys/types.h)
  AC_CHECK_HEADERS(sys/socket.h)
  AC_CHECK_HEADERS(sys/select.h)
 -AC_CHECK_HEADERS(sys/poll.h)
 +AC_CHECK_HEADERS(poll.h)
  AC_CHECK_HEADERS(netdb.h)
  AC_CHECK_HEADERS(arpa/inet.h)
  AC_CHECK_HEADERS(sys/resource.h)
@@@ -150,23 -149,6 +150,23 @@@ AC_CHECK_HEADERS(netinet/icmp6.h, [], [
  # include <netinet/ip6.h>
  #endif
  ])
 +AC_CHECK_HEADERS(netinet/tcp.h, [], [],
 +[#if HAVE_STDINT_H
 +# include <stdint.h>
 +#endif
 +#if HAVE_SYS_TYPES_H
 +# include <sys/types.h>
 +#endif
 +#if HAVE_NETINET_IN_SYSTM_H
 +# include <netinet/in_systm.h>
 +#endif
 +#if HAVE_NETINET_IN_H
 +# include <netinet/in.h>
 +#endif
 +#if HAVE_NETINET_IP_H
 +# include <netinet/ip.h>
 +#endif
 +])
  AC_CHECK_HEADERS(netinet/udp.h, [], [],
  [#if HAVE_STDINT_H
  # include <stdint.h>
@@@ -327,11 -309,9 +327,13 @@@ AC_CHECK_HEADERS(net/if_arp.h
  AC_CHECK_HEADERS(net/if_ppp.h)
  AC_CHECK_HEADERS(netinet/if_ether.h)
  
- dnl Checking for libraries
 +# For the multimeter plugin
 +AC_CHECK_HEADERS(termios.h)
 +AC_CHECK_HEADERS(sys/ioctl.h)
 +
+ #
+ # Checking for libraries
+ #
  AC_CHECK_LIB(m, ext)
  
  #
@@@ -386,98 -366,6 +388,98 @@@ AC_CHECK_FUNCS(getgrgid getpwuid
  # For traffic module
  AC_CHECK_FUNCS(getifaddrs)
  
 +# Check for NAN
 +nan_type="none"
 +if test "x$nan_type" = "xnone"; then
 +  AC_CACHE_CHECK([whether NAN is defined by default],
 +    [have_nan_default],
 +    AC_COMPILE_IFELSE(
 +      AC_LANG_PROGRAM(
 +      [[
 +#include <stdlib.h>
 +#include <math.h>
 +static float foo = NAN;
 +      ]],
 +      [[
 +       if (isnan (foo))
 +        return 0;
 +       else
 +      return 1;
 +      ]]),
 +      [have_nan_default="yes"],
 +      [have_nan_default="no"]
 +    )
 +  )
 +  if test "x$have_nan_default" = "xyes"
 +  then
 +   nan_type="default"
 +   AC_DEFINE(NAN_STATIC_DEFAULT, 1,
 +     [Define if NAN is defined by default and can initialize static variables.])
 +  fi
 +fi
 +if test "x$nan_type" = "xnone"; then
 +  AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99],
 +    [have_nan_isoc],
 +    AC_COMPILE_IFELSE(
 +      AC_LANG_PROGRAM(
 +      [[
 +#include <stdlib.h>
 +#define __USE_ISOC99 1
 +#include <math.h>
 +static float foo = NAN;
 +      ]],
 +      [[
 +       if (isnan (foo))
 +        return 0;
 +       else
 +      return 1;
 +      ]]),
 +      [have_nan_isoc="yes"],
 +      [have_nan_isoc="no"]
 +    )
 +  )
 +  if test "x$have_nan_isoc" = "xyes"
 +  then
 +   nan_type="isoc99"
 +   AC_DEFINE(NAN_STATIC_ISOC, 1,
 +     [Define if NAN is defined by __USE_ISOC99 and can initialize static variables.])
 +  fi
 +fi
 +if test "x$nan_type" = "xnone"; then
 +  AC_CACHE_CHECK([whether NAN can be defined by 0/0],
 +    [have_nan_zero],
 +    AC_RUN_IFELSE(
 +      AC_LANG_PROGRAM(
 +      [[
 +#include <stdlib.h>
 +#include <math.h>
 +#define NAN (0.0 / 0.0)
 +#ifndef isnan
 +# define isnan(f) ((f) != (f))
 +#endif
 +static float foo = NAN;
 +      ]],
 +      [[
 +       if (isnan (foo))
 +        return 0;
 +       else
 +      return 1;
 +      ]]),
 +      [have_nan_zero="yes"],
 +      [have_nan_zero="no"]
 +    )
 +  )
 +  if test "x$have_nan_zero" = "xyes"
 +  then
 +   nan_type="zero"
 +   AC_DEFINE(NAN_ZERO_ZERO, 1,
 +     [Define if NAN can be defined as (0.0 / 0.0)])
 +  fi
 +fi
 +if test "x$nan_type" = "xnone"; then
 +  AC_MSG_ERROR([Didn't find out how to statically initialize variables to NAN. Sorry.])
 +fi
 +
  # For mount interface
  #AC_CHECK_FUNCS(getfsent getvfsent)
  
@@@ -1041,6 -929,45 +1043,45 @@@ AC_DEFINE_UNQUOTED(COLLECT_LIBPCAP, [$c
        [Wether or not to use the pcap library])
  AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
  
+ AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
+ [
+       if test "x$withval" != "xno" && test "x$withval" != "xyes"
+       then
+               LDFLAGS="$LDFLAGS -L$withval/lib"
+               CPPFLAGS="$CPPFLAGS -I$withval/include"
+               with_libiptc="yes"
+       fi
+ ],
+ [
+       if test "x$ac_system" = "xLinux"
+       then
+               with_libiptc="yes"
+       else
+               with_libiptc="no (Linux only)"
+       fi
+ ])
+ if test "x$with_libiptc" = "xyes"
+ then
+       AC_CHECK_LIB(iptc, iptc_init,
+       [
+               AC_DEFINE(HAVE_LIBIPTC, 1, [Define to 1 if you have the iptc library (-liptc).])
+       ], [with_libiptc="no (libiptc not found)"])
+ fi
+ if test "x$with_libiptc" = "xyes"
+ then
+       AC_CHECK_HEADERS(libiptc/libiptc.h,
+       [
+               AC_DEFINE(HAVE_LIBIPTC_LIBIPTC_H, 1, [Define to 1 if you have the <libiptc/libiptc.h> header file.])
+       ], [with_libiptc="no (libiptc/libiptc.h not found)"])
+ fi
+ if test "x$with_libiptc" = "xyes"
+ then
+       collect_libiptc=1
+ else
+       collect_libiptc=0
+ fi
+ AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes")
  # Define `step' and `hearbeat' values..
  declare -i collectd_step=10
  declare -i collectd_heartbeat=25
@@@ -1155,20 -1082,18 +1196,21 @@@ AC_COLLECTD([battery],   [disable], [mo
  AC_COLLECTD([cpu],       [disable], [module], [cpu usage statistics])
  AC_COLLECTD([cpufreq],   [disable], [module], [system cpu frequency statistics])
  AC_COLLECTD([disk],      [disable], [module], [disk/partition statistics])
 +AC_COLLECTD([csv],       [disable], [module], [csv output plugin])
  AC_COLLECTD([df],        [disable], [module], [df statistics])
  AC_COLLECTD([dns],       [disable], [module], [dns statistics])
  AC_COLLECTD([email],     [disable], [module], [email statistics])
 -AC_COLLECTD([quota],     [enable],  [module], [quota statistics (experimental)])
 +AC_COLLECTD([entropy],   [disable], [module], [entropy statistics])
 +AC_COLLECTD([exec],      [disable], [module], [exec of external programs])
  AC_COLLECTD([hddtemp],   [disable], [module], [hdd temperature statistics])
+ AC_COLLECTD([iptables],  [disable], [module], [IPtables statistics])
  AC_COLLECTD([irq],       [disable], [module], [irq statistics])
  AC_COLLECTD([load],      [disable], [module], [system load statistics])
  AC_COLLECTD([mbmon],     [disable], [module], [motherboard monitor statistics])
  AC_COLLECTD([memory],    [disable], [module], [memory statistics])
  AC_COLLECTD([multimeter],[disable], [module], [multimeter statistics])
  AC_COLLECTD([mysql],     [disable], [module], [mysql statistics])
 +AC_COLLECTD([network],   [disable], [module], [network functionality])
  AC_COLLECTD([nfs],       [disable], [module], [nfs statistics])
  AC_COLLECTD([ntpd],      [disable], [module], [ntpd statistics])
  AC_COLLECTD([ping],      [disable], [module], [ping statistics])
@@@ -1176,15 -1101,13 +1218,15 @@@ AC_COLLECTD([processes], [disable], [mo
  AC_COLLECTD([sensors],   [disable], [module], [lm_sensors statistics])
  AC_COLLECTD([serial],    [disable], [module], [serial statistics])
  AC_COLLECTD([swap],      [disable], [module], [swap statistics])
 +AC_COLLECTD([syslog],    [disable], [module], [syslog log facility])
  AC_COLLECTD([tape],      [disable], [module], [tape statistics])
  AC_COLLECTD([traffic],   [disable], [module], [system traffic statistics])
 +AC_COLLECTD([unixsock],  [disable], [module], [UNIX socket plugin])
  AC_COLLECTD([users],     [disable], [module], [user count statistics])
  AC_COLLECTD([vserver],   [disable], [module], [vserver statistics])
  AC_COLLECTD([wireless],  [disable], [module], [wireless link statistics])
  
 -AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/libconfig/Makefile src/liboping/Makefile)
 +AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/liboconfig/Makefile src/liboping/Makefile)
  
  cat <<EOF;
  
@@@ -1199,6 -1122,7 +1241,7 @@@ Configuration
      libkstat  . . . . . $with_kstat
      libmysql  . . . . . $with_libmysql
      libpcap . . . . . . $with_libpcap
+     libiptc . . . . . . $with_libiptc
      libpthread  . . . . $with_libpthread
  
    Features:
      battery . . . . . . $enable_battery
      cpu . . . . . . . . $enable_cpu
      cpufreq . . . . . . $enable_cpufreq
 +    csv . . . . . . . . $enable_csv
      df  . . . . . . . . $enable_df
      disk  . . . . . . . $enable_disk
      dns . . . . . . . . $enable_dns
      email . . . . . . . $enable_email
 +    entropy . . . . . . $enable_entropy
 +    exec  . . . . . . . $enable_exec
      hddtemp . . . . . . $enable_hddtemp
      irq . . . . . . . . $enable_irq
+     iptables  . . . . . $enable_iptables
      load  . . . . . . . $enable_load
      mbmon . . . . . . . $enable_mbmon
      memory  . . . . . . $enable_memory
      multimeter  . . . . $enable_multimeter
      mysql . . . . . . . $enable_mysql
 +    network . . . . . . $enable_network
      nfs . . . . . . . . $enable_nfs
      ntpd  . . . . . . . $enable_ntpd
      ping  . . . . . . . $enable_ping
      sensors . . . . . . $enable_sensors
      serial  . . . . . . $enable_serial
      swap  . . . . . . . $enable_swap
 +    syslog  . . . . . . $enable_syslog
      tape  . . . . . . . $enable_tape
      traffic . . . . . . $enable_traffic
 +    unixsock  . . . . . $enable_unixsock
      users . . . . . . . $enable_users
      vserver . . . . . . $enable_vserver
      wireless  . . . . . $enable_wireless
diff --combined src/Makefile.am
@@@ -1,4 -1,4 +1,4 @@@
 -SUBDIRS = libconfig
 +SUBDIRS = liboconfig
  if BUILD_WITH_OWN_LIBOPING
  SUBDIRS += liboping
  endif
@@@ -8,19 -8,16 +8,19 @@@ AM_CFLAGS = -Wall -Werro
  endif
  
  sbin_PROGRAMS = collectd
 +bin_PROGRAMS = collectd-nagios
  
  collectd_SOURCES = collectd.c collectd.h \
                   utils_debug.c utils_debug.h \
 +                 utils_avltree.c utils_avltree.h \
                   utils_mount.c utils_mount.h \
 +                 utils_llist.c utils_llist.h \
                   utils_ignorelist.c utils_ignorelist.h \
                   common.c common.h \
 -                 network.c network.h \
                   plugin.c plugin.h \
                   configfile.c configfile.h
  collectd_CPPFLAGS = $(LTDLINCL)
 +collectd_CPPFLAGS += -DPREFIX='"${prefix}"'
  collectd_CPPFLAGS += -DCONFIGFILE='"${sysconfdir}/${PACKAGE_NAME}.conf"'
  collectd_CPPFLAGS += -DPKGLOCALSTATEDIR='"${localstatedir}/lib/${PACKAGE_NAME}"'
  if BUILD_FEATURE_DAEMON
@@@ -33,6 -30,9 +33,6 @@@ endi
  
  # Link to these libraries..
  collectd_LDFLAGS = -export-dynamic
 -if BUILD_WITH_RRDTOOL
 -collectd_LDFLAGS += -lm -lrrd
 -endif
  if BUILD_WITH_LIBRT
  collectd_LDFLAGS += -lrt
  endif
@@@ -60,10 -60,8 +60,10 @@@ collectd_LDFLAGS += -lstatgra
  endif
  
  
 -collectd_LDADD = $(LIBLTDL) libconfig/libconfig.la "-dlopen" self
 -collectd_DEPENDENCIES = $(LIBLTDL) libconfig/libconfig.la
 +collectd_LDADD = $(LIBLTDL) liboconfig/liboconfig.la "-dlopen" self
 +collectd_DEPENDENCIES = $(LIBLTDL) liboconfig/liboconfig.la
 +
 +collectd_nagios_SOURCES = collectd-nagios.c
  
  pkglib_LTLIBRARIES = 
  
@@@ -133,14 -131,6 +133,14 @@@ collectd_LDADD += "-dlopen" cpufreq.l
  collectd_DEPENDENCIES += cpufreq.la
  endif
  
 +if BUILD_MODULE_CSV
 +pkglib_LTLIBRARIES += csv.la
 +csv_la_SOURCES = csv.c
 +csv_la_LDFLAGS = -module -avoid-version
 +collectd_LDADD += "-dlopen" csv.la
 +collectd_DEPENDENCIES += csv.la
 +endif
 +
  if BUILD_MODULE_DF
  pkglib_LTLIBRARIES += df.la
  df_la_SOURCES = df.c
@@@ -196,25 -186,6 +196,25 @@@ collectd_LDADD += "-dlopen" email.l
  collectd_DEPENDENCIES += email.la
  endif
  
 +if BUILD_MODULE_ENTROPY
 +pkglib_LTLIBRARIES += entropy.la
 +entropy_la_SOURCES = entropy.c
 +entropy_la_LDFLAGS = -module -avoid-version
 +collectd_LDADD += "-dlopen" entropy.la
 +collectd_DEPENDENCIES += entropy.la
 +endif
 +
 +if BUILD_MODULE_EXEC
 +pkglib_LTLIBRARIES += exec.la
 +exec_la_SOURCES = exec.c
 +exec_la_LDFLAGS = -module -avoid-version
 +if BUILD_WITH_LIBPTHREAD
 +exec_la_LDFLAGS += -lpthread
 +endif
 +collectd_LDADD += "-dlopen" exec.la
 +collectd_DEPENDENCIES += exec.la
 +endif
 +
  #if BUILD_MODULE_QUOTA
  #pkglib_LTLIBRARIES += quota.la
  #quota_la_SOURCES = quota_plugin.c quota_plugin.h
@@@ -237,6 -208,17 +237,17 @@@ collectd_LDADD += "-dlopen" hddtemp.l
  collectd_DEPENDENCIES += hddtemp.la
  endif
  
+ if BUILD_MODULE_IPTABLES
+ pkglib_LTLIBRARIES += iptables.la
+ iptables_la_SOURCES = iptables.c
+ iptables_la_LDFLAGS = -module -avoid-version
+ if BUILD_WITH_LIBIPTC
+ iptables_la_LDFLAGS += -liptc
+ endif
+ collectd_LDADD += "-dlopen" iptables.la
+ collectd_DEPENDENCIES += iptables.la
+ endif
  if BUILD_MODULE_IRQ
  pkglib_LTLIBRARIES += irq.la
  irq_la_SOURCES = irq.c
@@@ -315,20 -297,6 +326,20 @@@ collectd_LDADD += "-dlopen" mysql.l
  collectd_DEPENDENCIES += mysql.la
  endif
  
 +if BUILD_MODULE_NETWORK
 +pkglib_LTLIBRARIES += network.la
 +network_la_SOURCES = network.c
 +network_la_LDFLAGS = -module -avoid-version
 +if BUILD_WITH_LIBSOCKET
 +network_la_LDFLAGS += -lsocket
 +endif
 +if BUILD_WITH_LIBPTHREAD
 +network_la_LDFLAGS += -lpthread
 +endif
 +collectd_LDADD += "-dlopen" network.la
 +collectd_DEPENDENCIES += network.la
 +endif
 +
  if BUILD_MODULE_NFS
  pkglib_LTLIBRARIES += nfs.la
  nfs_la_SOURCES = nfs.c
@@@ -372,14 -340,6 +383,14 @@@ collectd_LDADD += "-dlopen" processes.l
  collectd_DEPENDENCIES += processes.la
  endif
  
 +if BUILD_WITH_RRDTOOL
 +pkglib_LTLIBRARIES += rrdtool.la
 +rrdtool_la_SOURCES = rrdtool.c
 +rrdtool_la_LDFLAGS = -module -avoid-version -lrrd
 +collectd_LDADD += "-dlopen" rrdtool.la
 +collectd_DEPENDENCIES += rrdtool.la
 +endif
 +
  if BUILD_MODULE_SENSORS
  pkglib_LTLIBRARIES += sensors.la
  sensors_la_SOURCES = sensors.c
@@@ -422,14 -382,6 +433,14 @@@ swap_la_LDFLAGS += -lstatgra
  endif
  endif
  
 +if BUILD_MODULE_SYSLOG
 +pkglib_LTLIBRARIES += syslog.la
 +syslog_la_SOURCES = syslog.c
 +syslog_la_LDFLAGS = -module -avoid-version
 +collectd_LDADD += "-dlopen" syslog.la
 +collectd_DEPENDENCIES += syslog.la
 +endif
 +
  if BUILD_MODULE_TAPE
  pkglib_LTLIBRARIES += tape.la
  tape_la_SOURCES = tape.c
@@@ -467,17 -419,6 +478,17 @@@ traffic_la_LDFLAGS += -lstatgra
  endif
  endif
  
 +if BUILD_MODULE_UNIXSOCK
 +pkglib_LTLIBRARIES += unixsock.la
 +unixsock_la_SOURCES = unixsock.c
 +unixsock_la_LDFLAGS = -module -avoid-version
 +if BUILD_WITH_LIBPTHREAD
 +unixsock_la_LDFLAGS += -lpthread
 +endif
 +collectd_LDADD += "-dlopen" unixsock.la
 +collectd_DEPENDENCIES += unixsock.la
 +endif
 +
  if BUILD_MODULE_USERS
  pkglib_LTLIBRARIES += users.la
  users_la_SOURCES = users.c
diff --combined src/collectd.conf.in
@@@ -4,15 -4,21 +4,15 @@@
  # http://collectd.org/
  #
  
 -# Select one of the following modes:
 -@BUILD_WITH_RRDTOOL_TRUE@Mode Local
 -#Mode Server
 -@BUILD_WITH_RRDTOOL_FALSE@Mode Client
 -#Mode Log
 -
  # Set the IP-address(es) and UDP-port(s) to send packets to. `Listen' can be
  # used as a synonym for `Server' to make the config file more readable when in
  # server mode. The port option is optional.
  #Server ff18::efc0:4a42 25826
  #Server 239.192.74.66 25826
  
 -#DataDir   /opt/collectd/var/lib/collectd
 -#PIDFile   /opt/collectd/var/run/collectd.pid
 -#PluginDir /opt/collectd/lib/collectd
 +#BaseDir   "/opt/collectd/var/lib/collectd"
 +#PIDFile   "/opt/collectd/var/run/collectd.pid"
 +#PluginDir "/opt/collectd/lib/collectd"
  
  @BUILD_MODULE_APACHE_TRUE@LoadPlugin apache
  @BUILD_MODULE_APCUPS_TRUE@LoadPlugin apcups
  @BUILD_MODULE_BATTERY_TRUE@LoadPlugin battery
  @BUILD_MODULE_CPU_TRUE@LoadPlugin cpu
  @BUILD_MODULE_CPUFREQ_TRUE@LoadPlugin cpufreq
 +@BUILD_MODULE_CSV_TRUE@LoadPlugin csv
  @BUILD_MODULE_DF_TRUE@LoadPlugin df
  @BUILD_MODULE_DISK_TRUE@LoadPlugin disk
  @BUILD_MODULE_DNS_TRUE@LoadPlugin dns
 +@BUILD_MODULE_EMAIL_TRUE@LoadPlugin email
  @BUILD_MODULE_HDDTEMP_TRUE@LoadPlugin hddtemp
+ @BUILD_MODULE_IPTABLES_TRUE@LoadPlugin iptables
  @BUILD_MODULE_IRQ_TRUE@LoadPlugin irq
  @BUILD_MODULE_LOAD_TRUE@LoadPlugin load
  @BUILD_MODULE_MBMON_TRUE@LoadPlugin mbmon
  @BUILD_MODULE_MEMORY_TRUE@LoadPlugin memory
  @BUILD_MODULE_MULTIMETER_TRUE@LoadPlugin multimeter
  @BUILD_MODULE_MYSQL_TRUE@LoadPlugin mysql
 +@BUILD_MODULE_NETWORK_TRUE@LoadPlugin network
  @BUILD_MODULE_NFS_TRUE@LoadPlugin nfs
  @BUILD_MODULE_NTPD_TRUE@LoadPlugin ntpd
  @BUILD_MODULE_PING_TRUE@LoadPlugin ping
  @BUILD_MODULE_PROCESSES_TRUE@LoadPlugin processes
 +@BUILD_WITH_RRDTOOL_TRUE@LoadPlugin rrdtool
  @BUILD_MODULE_SENSORS_TRUE@LoadPlugin sensors
  @BUILD_MODULE_SERIAL_TRUE@LoadPlugin serial
  @BUILD_MODULE_SWAP_TRUE@LoadPlugin swap
  @BUILD_MODULE_WIRELESS_TRUE@LoadPlugin wireless
  
  #<Plugin apache>
 -#     URL http://localhost/status?auto
 -#     User www-user
 -#     Password secret
 -#     CACert /etc/ssl/ca.crt
 +#     URL "http://localhost/status?auto"
 +#     User "www-user"
 +#     Password "secret"
 +#     CACert "/etc/ssl/ca.crt"
  #</Plugin>
  
  #<Plugin apcups>
 -#     Host localhost
 -#     Port 3551
 +#     Host "localhost"
 +#     Port "3551"
 +#</Plugin>
 +
 +#<Plugin csv>
 +#     DataDir "/var/lib/collectd/csv"
  #</Plugin>
  
  #<Plugin dns>
 -#     Interface eth0
 -#     IgnoreSource 192.168.0.1
 +#     Interface "eth0"
 +#     IgnoreSource "192.168.0.1"
  #</Plugin>
  
  #<Plugin hddtemp>
 -#     Host 127.0.0.1
 +#     Host "127.0.0.1"
  #     Port 7634
  #</Plugin>
  
+ #<Plugin iptables>
+ #     Chain table chain
+ #</Plugin>
  #<Plugin irq>
  #     Irq 7
  #     Irq 8
  #</Plugin>
  
  #<Plugin mbmon>
 -#     Host 127.0.0.1
 +#     Host "127.0.0.1"
  #     Port 411
  #</Plugin>
  
 +#<Plugin network>
 +#     Server "ff18::efc0:4a42" "25826"
 +#     Server "239.192.74.66" "25826"
 +#     Listen "ff18::efc0:4a42" "25826"
 +#     Listen "239.192.74.66" "25826"
 +#     TimeToLive "128"
 +#</Plugin>
 +
  #<Plugin ntpd>
 -#     Host localhost
 +#     Host "localhost"
  #     Port 123
  #</Plugin>
  
  #<Plugin mysql>
 -#     Host database.serv.er
 -#     User db_user
 -#     Password secret
 -#     Database db_name
 +#     Host "database.serv.er"
 +#     User "db_user"
 +#     Password "secret"
 +#     Database "db_name"
  #</Plugin>
  
  #<Plugin ping>
 -#     Host host.foo.bar
 +#     Host "host.foo.bar"
  #</Plugin>
  
  #<Plugin processes>
 -#     Process name
 +#     Process "name"
 +#</Plugin>
 +
 +#<Plugin rrdtool>
 +#     DataDir "/var/lib/collectd/rrd"
 +#     StepSize      10
 +#     HeartBeat     20
 +#     RRARows     1200
 +#     XFF            0.1
 +#     CacheTimeout 120
 +#     CacheFlush   900
  #</Plugin>
  
  ## There are two different naming schemes for the sensors plugin, to preserver
  ## backwards compatibility. The `extended naming' is prefered, but not the
  ## default for this reason. See `collectd.conf(5)' for more information.
  #<Plugin sensors>
 -#     ExtendedSensorNaming false
 -#     Sensor it8712-temp1
 -#     Sensor it8712-fan3
 -#     Sensor it8712-in8
 -## -- OR --
 -#     ExtendedSensorNaming true
 -#     Sensor it8712-isa-0290/temperature-temp1
 -#     Sensor it8712-isa-0290/fanspeed-fan3
 -#     Sensor it8712-isa-0290/voltage-in8
 +#     Sensor "it8712-isa-0290/temperature-temp1"
 +#     Sensor "it8712-isa-0290/fanspeed-fan3"
 +#     Sensor "it8712-isa-0290/voltage-in8"
  #
  #     IgnoreSelected false
  #</Plugin>
  
  #<Plugin traffic>
 -#     Interface eth0
 +#     Interface "eth0"
  #     IgnoreSelected false
  #</Plugin>
diff --combined src/collectd.conf.pod
@@@ -4,44 -4,42 +4,44 @@@ collectd.conf - Configuration for the s
  
  =head1 SYNOPSIS
  
 -  Mode    Client
 -  DataDir /path/to/data/
 -  PIDFile /path/to/pidfile/collectd.pid
 -  LogFile /path/to/logfile/collectd.log
 -  Server  123.123.123.123 12345
 +  BaseDir "/path/to/data/"
 +  PIDFile "/path/to/pidfile/collectd.pid"
 +  LogFile "/path/to/logfile/collectd.log"
 +  Server  "123.123.123.123" 12345
  
    LoadPlugin cpu
    LoadPlugin load
    LoadPlugin ping
  
    <Plugin ping>
 -    Host example.org
 -    Host provider.net
 +    Host "example.org"
 +    Host "provider.net"
    </Plugin>
  
  =head1 DESCRIPTION
  
  This config file controls how the system statistics collection daemon
 -B<collectd> behaves. The most significant options are B<Mode>, which controlls
 -if the daemon will act as client, server or will be independent in local mode,
 -and B<LoadPlugin> which controls which plugins to load.
 +B<collectd> behaves. The most significant option is B<LoadPlugin>, which
 +controls which plugins to load. These plugins ultimately define collectd's
 +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
  section-start or -end. Empty lines and everything after the hash-symbol `#' is
 -ignored.
 +ignored. Values are either string, enclosed in double-quotes,
 +(floating-point-)numbers or a boolean extression, 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 GLOBAL OPTIONS
  
  =over 4
  
 -=item B<Mode> (B<Local>|B<Client>|B<Server>|B<Log>)
 +=item B<BaseDir> I<Directory>
  
 -Sets the operating mode. See the section B<MODES> in L<collectd(1)> for a
 -description. This option determines which other options are allowed. Defaults
 -to B<Local>.
 +Sets the base directory. This is the directory beneath all RRD-files are
 +created. Possibly more subdirectories are created. This is also the working
 +directory for the daemon.
  
  =item B<LoadPlugin> I<Plugin>
  
@@@ -52,20 -50,52 +52,20 @@@ will be mostly useless. The names of th
  
  Sets where to write the PID file to. This file is overwritten when it exists
  and deleted when the program ist stopped. Some init-scripts might override this
 -setting using the B<-P> commandline option. Available in B<all modes>.
 -
 -=item B<DataDir> I<Directory>
 -
 -Sets the data directory. This is the directory beneath all RRD-files are
 -created. Possibly more subdirectories are created. This is also the working
 -directory for the daemon. Available in B<all modes>, though the B<Client> mode
 -won't write to this directory.
 +setting using the B<-P> commandline option.
  
  =item B<LogFile> I<File>
  
  Sets the file to write debugging output to. This is only used if compiled with
 -debugging enabled. It's ignored otherwise. Available in B<all modes>.
 -
 -=item B<Listen> I<Host> [I<Port>]
 -
 -=item B<Server> I<Host> [I<Port>]
 -
 -In B<client mode> the B<Server> statement sets the server to send datagrams to.
 -The statement may occur multiple times to send each datagram to multiple
 -destinations.
 +debugging enabled. It's ignored otherwise.
  
 -In B<server mode> the B<Listen> statement sets the interfaces to bind to. When
 -multiple statements are found the daemon will bind to multiple interfaces.
 -
 -The argument I<Host> may be a hostname, an IPv4 address or an IPv6 address. If
 -the argument is a multicast address the daemon will join that multicast group.
 +=item B<Interval> I<Seconds>
  
 -If no B<Listen> statement is found the server tries join both, the IPv6
 -multicast group and the 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.
 -
 -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
 -default port B<25826> is assumed.
 -
 -=item B<TimeToLive> I<1-255>
 -
 -Set the time-to-live of sent packets. This applies to all, unicast and
 -multicast, and IPv4 and IPv6 packets. The default is to not change this value.
 -That means that multicast packets will be sent with a TTL of C<1> (one) on most
 -operating systems.
 +Configures the interval in which to query the read plugins. Obviously smaller
 +values lead to a higher system load produces by collectd, while higher values
 +lead to more coarse statistics. Please note that changing this value may render
 +your RRD-files unuseable, if you use the C<rrdtool plugin>. You have been
 +warned.
  
  =back
  
@@@ -88,6 -118,10 +88,10 @@@ the following snipped to base your Apac
      </Location>
    </IfModule>
  
+ Since it's C<mod_status> module is very similar to Apache's, B<lighttpd> is
+ also supported. It introduces a new field, called C<BusyServers>, to count the
+ number of currently connected clients. This field is also supported.
  The following options are accepted by the C<apache>-plugin:
  
  =over 4
@@@ -130,17 -164,6 +134,17 @@@ TCP-Port to connect to. Defaults to B<3
  
  =back
  
 +=head2 Plugin C<csv>
 +
 +=over 4
 +
 +=item B<DataDir> I<Directory>
 +
 +Set the directory to store RRD-files under. Per default RRD-files are generated
 +beneath the daemon's working directory, i.E<nbsp>e. the B<BaseDir>.
 +
 +=back
 +
  =head2 Plugin C<df>
  
  =over 4
@@@ -256,6 -279,20 +260,6 @@@ TCP-Port to connect to. Defaults to B<4
  
  =back
  
 -=head2 Plugin C<ntpd>
 -
 -=over 4
 -
 -=item B<Host> I<Hostname>
 -
 -Hostname of the host running B<ntpd>. Defaults to B<localhost>.
 -
 -=item B<Port> I<Port>
 -
 -UDP-Port to connect to. Defaults to B<123>.
 -
 -=back
 -
  =head2 Plugin C<mysql>
  
  =over 4
@@@ -279,58 -316,6 +283,58 @@@ option for what this plugin does
  
  =back
  
 +=head2 Plugin C<network>
 +
 +=over 4
 +
 +=item B<Listen> I<Host> [I<Port>]
 +
 +=item B<Server> I<Host> [I<Port>]
 +
 +The B<Server> statement sets the server to send datagrams B<to>.  The statement
 +may occur multiple times to send each datagram to multiple destinations.
 +
 +The B<Listen> statement sets the interfaces to bind to. When multiple
 +statements are found the daemon will bind to multiple interfaces.
 +
 +The argument I<Host> may be a hostname, an IPv4 address or an IPv6 address. If
 +the argument is a multicast address the daemon will join that multicast group.
 +
 +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.
 +
 +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
 +default port B<25826> is assumed.
 +
 +=item B<TimeToLive> I<1-255>
 +
 +Set the time-to-live of sent packets. This applies to all, unicast and
 +multicast, and IPv4 and IPv6 packets. The default is to not change this value.
 +That means that multicast packets will be sent with a TTL of C<1> (one) on most
 +operating systems.
 +
 +=back
 +
 +=head2 Plugin C<ntpd>
 +
 +=over 4
 +
 +=item B<Host> I<Hostname>
 +
 +Hostname of the host running B<ntpd>. Defaults to B<localhost>.
 +
 +=item B<Port> I<Port>
 +
 +UDP-Port to connect to. Defaults to B<123>.
 +
 +=back
 +
  =head2 Plugin C<ping>
  
  =over 4
@@@ -346,94 -331,65 +350,94 @@@ Sets the Time-To-Live of generated ICM
  
  =back
  
 +=head2 Plugin C<rrdtool>
 +
 +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.
 +
 +=over 4
 +
 +=item B<DataDir> I<Directory>
 +
 +Set the directory to store CSV-files under. Per default CSV-files are generated
 +beneath the daemon's working directory, i.E<nbsp>e. the B<BaseDir>.
 +
 +=item B<StepSize> I<Seconds>
 +
 +Sets the stepsize of newly created RRD-files. Ideally (and per default) this
 +setting is identical to the global B<Interval>-option and should not be
 +smaller. If unsure, don't set this option.
 +
 +=item B<HeartBeat> I<Seconds>
 +
 +Sets the heartbeat of newly created RRD-files. Ideally (and per default) this
 +setting is bigger than the B<Interval>-setting. If unsure, don't set this
 +option.
 +
 +=item B<RRARows> I<NumRows>
 +
 +The C<rrdtool plugin> calculates the number of PDPs per CDP based on the
 +B<StepSize>, this setting and a timespan. This plugin creates RRD-files with
 +three times five RRAs, i. e. five RRAs with the CFs B<MIN>, B<AVERAGE>, and
 +B<MAX>. The five RRAs are optimized for graphs covering one hour, one day, one
 +week, one month, and one year.
 +
 +So for each timespan, it calculates how many PDPs need to be consolidated into
 +one CDP by calculating:
 +  number of PDPs = timespan / (stepsize * rrarows)
 +
 +Bottom line is, set this no smaller than the width of you graphs in pixels.
 +
 +=item B<XFF> I<Factor>
 +
 +Set the "XFiles Factor". This is mostly interesting if you set B<StepSize>
 +bigger than B<Interval>. If unsure, don't set this option.
 +
 +=item B<CacheFlush> I<Seconds>
 +
 +When the C<rrdtool plugin> uses a cache (by setting B<CacheTimeout>, see below)
 +it writes all values for a certain RRD-file if the oldest value is older than
 +(or equal to) the number of seconds specified. If some RRD-file is not updated
 +anymore for some reason (the computer was shut down, the network is broken,
 +etc.) some values may still be in the cache. If B<CacheFlush> is set, then the
 +entire cache is searched for entries older than B<CacheTimeout> seconds and
 +written to disk every I<Seconds> seconds. Since this is kind of expensive and
 +does nothing under normal circumstances, this value should not be too small.
 +900 seconds might be a good value, though setting this to 7200 seconds doesn't
 +normally do much harm either.
 +
 +=item B<CacheTimeout> I<Seconds>
 +
 +If this option is set to a value greater than zero, the C<rrdtool plugin> will
 +save values in a cache, as described above. Writing multiple values at once
 +reduces IO-operations and thus lessens the load produced by updating the files.
 +The tradeoff is that the graphs kind of "drag behind" and that more memory is
 +used.
 +
 +=back
 +
  =head2 Plugin C<sensors>
  
  =over 4
  
 -=item B<ExtendedSensorNaming> I<true>|I<false>
 -
 -If set to I<true> this option switches on the extended sensors and RRD-files
 -naming. This option exists to preserve backwards compatibility. It is
 -recommended that you set this option to I<true>. The default is I<false> to
 -maintain compatibility only.
 -
 -Sensors get names like I<chip-bus-address/type-feature> (e.g.
 -I<it8712-isa-0290/voltage-in1>) and RRD files are therefore stored in a
 -standalone directory inside the B<DataDir> directory and get names like
 -I<lm_sensors-chip-bus-address/type-feature.rrd> (e.g.
 -I<lm_sensors-it8712-isa-0290/voltage-in1.rrd>).
 -
 -The B<ExtendedSensorNaming> option breaks the compatibility with previous
 -sensors and RRD files naming and the place where RRDs are stored. If you turn
 -it on, the plugin will create new RRD files in a standalone directory inside
 -the B<DataDir> directory and without previous history. You can rename ``old''
 -RRD-files to preserve already collected statistics, because the file layout
 -hasn't changed. If you have two chips of the same type, you need to use
 -B<ExtendedSensorNaming> in order to collect information from both chips.
 -
 -If not set or set to I<false>, the extended naming is not active. Sensors get
 -names like I<chip-feature> (e.g. I<it8712-in1>) and RRD files are stored in the
 -main B<DataDir> directory and get names like I<sensors-chip-feature.rrd> (e.g.
 -I<sensors-it8712-in1.rrd>).  You simply continue using the plugin the old way
 -and additionally also getting data for newly added sensors in this mode.
 -
 -=item B<Sensor> I<chip-feature> or B<Sensor> I<chip-bus-address/type-feature>
 -
 -Both option modes select the name of the sensor which you want to collect.
 -The naming scheme is dependent on the state of the B<ExtendedSensorNaming>
 -option (see previous option). Both option modes can also deselect the
 -sensor according to the B<IgnoreSelected> option (see below).
 -
 -For example the option "B<Sensor> I<it8712-in1>" will cause the collectd
 -to gather data for the voltage sensor I<in1> of the I<it8712> chip in case
 -of the B<ExtendedSensorNaming> option is set to I<false>.
 -
 -And likewise the option "B<Sensor> I<it8712-isa-0290/voltage-in1>" will
 -cause the collectd to gather data for the voltage sensor I<in1> of the I<it8712>
 -on the isa bus at the address 0290 in case of the B<ExtendedSensorNaming>
 -option set to I<true>.
 +=item B<Sensor> I<chip-bus-address/type-feature>
  
 -=item B<IgnoreSelected> I<true>|I<false>
 +Selects the name of the sensor which you want to collect or ignore, depending
 +on the B<IgnoreSelected> below. For example, the option "B<Sensor>
 +I<it8712-isa-0290/voltage-in1>" will cause collectd to gather data for the
 +voltage sensor I<in1> of the I<it8712> on the isa bus at the address 0290.
  
 -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 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.
 +=item B<IgnoreSelected> I<true>|I<false>
  
 -back
 +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
 +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.
  
  =back