Merge branch 'collectd-3.11' into merge/collectd-4
authorFlorian Forster <octo@leeloo.lan.home.verplant.org>
Sat, 10 Feb 2007 10:30:18 +0000 (11:30 +0100)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Sat, 10 Feb 2007 10:30:18 +0000 (11:30 +0100)
Conflicts:

configure.in
src/processes.c

ChangeLog
README
collectd.spec
configure.in
src/Makefile.am
src/dns.c
src/processes.c
src/utils_dns.c
src/utils_mount.c

index b20bcb4..7756695 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-02-10, Version 3.11.1
+       * df plugin: Some wrong defines have been fixed so the plugin works
+         under Solaris again.
+       * dns plugin: The usage of a struct has been fixed to work with
+         non-GNU libcs.
+       * processes plugin: Some missing defines have been added so the plugin
+         compiles cleanly under FreeBSD and presumably other UNIXes.
+
 2006-12-22, Version 3.11.0
        * collectd: The new command line option `-P' makes it easier for
          distributors to change the location of PID-files.
diff --git a/README b/README
index 0fd3726..4a09fee 100644 (file)
--- a/README
+++ b/README
@@ -51,9 +51,15 @@ Features
     - System load
       (Load average over the last 1, 5 and 15 minutes)
 
+    - mbmon - motherboard monitoring
+      (temperature, fanspeed and voltage information)
+
     - Memory utilization
       (Memory occupied by running processes, page cache, buffer cache and free)
 
+    - Multimeter
+      (Information provided by serial multimeters, such as the «Metex M-4650CR»)
+
     - MySQL server statistics
       (Commands issued, handlers triggered, thread usage, query cache
       utilization and traffic sent/received)
@@ -136,22 +142,31 @@ Prerequisites
 
   * Usual suspects: C compiler, linker, preprocessor, make, ...
 
-  * rrdtool (headers and library; rrdtool 1.0 and 1.2 both work fine)
+  * rrdtool (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 it's values via multicast and not create any RRD files itself.
+    Alternatively you can chose to write CSV-files (Comma Seperated Values)
+    instead.
 
   * libmysqlclient (optional)
 
   * lm-sensors (optional)
 
   * libstatgrab may be used to collect statistics on systems other than Linux
-    and/or Solaris. Note that CPU- and disk-statistics, while being provided by
-    this library, are not supported in collectd right now..
+    and/or Solaris. Note that CPU- and disk-statistics, while being provided
+    by this library, are not supported in collectd right now..
     <http://www.i-scream.org/libstatgrab/> 
 
   * libcurl (optional)
     If you want to use the `apache' plugin
 
+  * librt, libsocket, libkstat, libdevinfo
+    Various standard Solaris libraries which provide system functions.
+
+  * libpthread (optional)
+    For parallelization, especially for plugins that communicate with the
+    outside, e. g. with a socket.
+
   * CoreFoundation.framework and IOKit.framework
     For copiling on darwin in general and the `apple_sensors' plugin in
     particular.
index 387763c..d5b08af 100644 (file)
@@ -1,7 +1,7 @@
 Summary:       Statistics collection daemon for filling RRD files.
 Name:           collectd
-Version:       3.10.0
-Release:       1
+Version:       3.11.0
+Release:       0
 Source:                http://collectd.org/files/%{name}-%{version}.tar.gz
 License:       GPL
 Group:         System Environment/Daemons
@@ -46,13 +46,13 @@ rm -rf $RPM_BUILD_ROOT
 %setup
 
 %build
-./configure --prefix=%{_prefix} --sbindir=%{_sbindir} --mandir=%{_mandir} --libdir=%{_libdir}
+./configure --prefix=%{_prefix} --sbindir=%{_sbindir} --mandir=%{_mandir} --libdir=%{_libdir} --sysconfdir=%{_sysconfdir}
 make
 
 %install
 make install DESTDIR=$RPM_BUILD_ROOT
 mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
-cp contrib/collectd.conf $RPM_BUILD_ROOT/etc/collectd.conf
+cp src/collectd.conf $RPM_BUILD_ROOT/etc/collectd.conf
 cp contrib/init.d-rh7 $RPM_BUILD_ROOT/etc/rc.d/init.d/collectd
 mkdir -p $RPM_BUILD_ROOT/var/lib/collectd
 rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/*.a
@@ -77,8 +77,11 @@ rm -rf $RPM_BUILD_ROOT
 %attr(0444,root,root) %{_libdir}/%{name}/cpufreq.so*
 %attr(0444,root,root) %{_libdir}/%{name}/df.so*
 %attr(0444,root,root) %{_libdir}/%{name}/disk.so*
+%attr(0444,root,root) %{_libdir}/%{name}/dns.so
+%attr(0444,root,root) %{_libdir}/%{name}/email.so
 %attr(0444,root,root) %{_libdir}/%{name}/hddtemp.so*
 %attr(0444,root,root) %{_libdir}/%{name}/load.so*
+%attr(0444,root,root) %{_libdir}/%{name}/mbmon.so
 %attr(0444,root,root) %{_libdir}/%{name}/memory.so*
 %attr(0444,root,root) %{_libdir}/%{name}/multimeter.so*
 %attr(0444,root,root) %{_libdir}/%{name}/nfs.so*
@@ -92,6 +95,7 @@ rm -rf $RPM_BUILD_ROOT
 %attr(0444,root,root) %{_libdir}/%{name}/users.so*
 %attr(0444,root,root) %{_libdir}/%{name}/vserver.so*
 %attr(0444,root,root) %{_libdir}/%{name}/wireless.so*
+
 %dir /var/lib/collectd
 
 %files apache
index ba936d8..09e1a18 100644 (file)
@@ -1,5 +1,5 @@
 dnl Process this file with autoconf to produce a configure script.
-AC_INIT(collectd, 3.11.0)
+AC_INIT(collectd, 3.11.1)
 AC_CONFIG_SRCDIR(src/collectd.c)
 AC_CONFIG_HEADERS(src/config.h)
 AM_INIT_AUTOMAKE(dist-bzip2)
@@ -149,6 +149,40 @@ 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>
+#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
+])
 
 # For cpu modules
 AC_CHECK_HEADERS(sys/sysctl.h sys/dkstat.h)
@@ -291,8 +325,6 @@ AC_CHECK_HEADERS(arpa/nameser.h arpa/nameser_compat.h)
 AC_CHECK_HEADERS(net/if_arp.h)
 AC_CHECK_HEADERS(net/if_ppp.h)
 AC_CHECK_HEADERS(netinet/if_ether.h)
-AC_CHECK_HEADERS(netinet/tcp.h)
-AC_CHECK_HEADERS(netinet/udp.h)
 
 # For the multimeter plugin
 AC_CHECK_HEADERS(termios.h)
@@ -457,6 +489,47 @@ AC_CHECK_MEMBERS([struct net_device_stats.rx_bytes, struct net_device_stats.tx_p
        #include <linux/netdevice.h>
        ])
 
+AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [],
+[#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
+#if HAVE_NETINET_UDP_H
+# include <netinet/udp.h>
+#endif
+])
+AC_CHECK_MEMBERS([struct udphdr.dest, struct udphdr.source], [], [],
+[#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
+#if HAVE_NETINET_UDP_H
+# include <netinet/udp.h>
+#endif
+])
+
 AC_MSG_CHECKING([for kernel type ($host_os)])
 case $host_os in
        *linux*)
@@ -557,11 +630,11 @@ fi
 
 if test "x$with_kstat" = "xyes"
 then
-       AC_CHECK_LIB(kstat, kstat_open,, [with_kstat="no (libkstat not found)"])
+       AC_CHECK_LIB(kstat, kstat_open, [with_kstat="yes"], [with_kstat="no (libkstat not found)"], [])
 fi
 if test "x$with_kstat" = "xyes"
 then
-       AC_CHECK_LIB(devinfo, di_init,, [with_devinfo="no (not found)"])
+       AC_CHECK_LIB(devinfo, di_init, [with_devinfo="yes"], [with_devinfo="no (not found)"], [])
        AC_CHECK_HEADERS(kstat.h,, [with_kstat="no (kstat.h not found)"])
 fi
 if test "x$with_kstat" = "xyes"
index 1efdb1a..aaa25f8 100644 (file)
@@ -167,7 +167,12 @@ endif
 
 if BUILD_MODULE_DNS
 pkglib_LTLIBRARIES += dns.la
-dns_la_SOURCES = dns.c utils_dns.c utils_dns.h
+dns_la_SOURCES = dns.c
+if BUILD_WITH_LIBPCAP
+if BUILD_WITH_LIBPTHREAD
+dns_la_SOURCES += utils_dns.c utils_dns.h
+endif
+endif
 dns_la_LDFLAGS = -module -avoid-version
 if BUILD_WITH_LIBPCAP
 dns_la_LDFLAGS += -lpcap
index d4e56da..332ef0e 100644 (file)
--- a/src/dns.c
+++ b/src/dns.c
@@ -24,9 +24,9 @@
 #include "plugin.h"
 #include "configfile.h"
 #include "utils_debug.h"
-#include "utils_dns.h"
 
 #if HAVE_LIBPCAP && HAVE_LIBPTHREAD
+# include "utils_dns.h"
 # include <pthread.h>
 # include <pcap.h>
 # include <poll.h>
index b1f9fbb..c22f0f6 100644 (file)
@@ -151,12 +151,14 @@ static data_set_t pagefaults_ds =
 };
 
 #if PROCESSES_HAVE_READ
+#if HAVE_THREAD_INFO | KERNEL_LINUX
 static const char *config_keys[] =
 {
        "Process",
        NULL
 };
 static int config_keys_num = 1;
+#endif
 
 typedef struct procstat_entry_s
 {
@@ -199,7 +201,9 @@ typedef struct procstat
        struct procstat_entry_s *instances;
 } procstat_t;
 
+#if HAVE_THREAD_INFO | KERNEL_LINUX
 static procstat_t *list_head_g = NULL;
+#endif
 
 #if HAVE_THREAD_INFO
 static mach_port_t port_host_self;
@@ -410,7 +414,6 @@ static void ps_list_reset (void)
                } /* while (pse != NULL) */
        } /* for (ps = list_head_g; ps != NULL; ps = ps->next) */
 }
-#endif /* HAVE_THREAD_INFO | KERNEL_LINUX */
 
 static int ps_config (const char *key, const char *value)
 {
@@ -425,6 +428,7 @@ static int ps_config (const char *key, const char *value)
 
        return (0);
 }
+#endif /* HAVE_THREAD_INFO | KERNEL_LINUX */
 
 static int ps_init (void)
 {
@@ -1083,8 +1087,10 @@ void module_register (void)
        plugin_register_data_set (&pagefaults_ds );
 
 #if PROCESSES_HAVE_READ
+#if HAVE_THREAD_INFO | KERNEL_LINUX
        plugin_register_config ("processes", ps_config,
                        config_keys, config_keys_num);
+#endif
        plugin_register_init ("processes", ps_init);
        plugin_register_read ("processes", ps_read);
 #endif /* PROCESSES_HAVE_READ */
index e9aec38..6541b89 100644 (file)
@@ -35,6 +35,9 @@
 
 #include "collectd.h"
 
+#if HAVE_NETINET_IN_SYSTM_H
+# include <netinet/in_systm.h>
+#endif
 #if HAVE_NETINET_IN_H
 # include <netinet/in.h>
 #endif
 # include <netdb.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
 # define PPP_CONTROL_VAL 0x03  /* The control byte value */
 #endif
 
-#ifdef __linux__
-#define uh_sport source
-#define uh_dport dest
+#if HAVE_STRUCT_UDPHDR_UH_DPORT && HAVE_STRUCT_UDPHDR_UH_SPORT
+# define UDP_DEST uh_dport
+# define UDP_SRC  uh_dport
+#elif HAVE_STRUCT_UDPHDR_DEST && HAVE_STRUCT_UDPHDR_SOURCE
+# define UDP_DEST dest
+# define UDP_SRC  source
+#else
+# error "`struct udphdr' is unusable."
 #endif
 
 #include "utils_dns.h"
@@ -409,8 +411,8 @@ handle_udp(const struct udphdr *udp, int len,
        const struct in6_addr *d_addr)
 {
     char buf[PCAP_SNAPLEN];
-    if ((ntohs (udp->uh_dport) != 53)
-                   && (ntohs (udp->uh_sport) != 53))
+    if ((ntohs (udp->UDP_DEST) != 53)
+                   && (ntohs (udp->UDP_SRC) != 53))
        return 0;
     memcpy(buf, udp + 1, len - sizeof(*udp));
     if (0 == handle_dns(buf, len - sizeof(*udp), s_addr, d_addr))
index a02e569..7748c61 100644 (file)
@@ -638,8 +638,10 @@ cu_mount_t *cu_mount_getlist(cu_mount_t **list)
        new = cu_mount_listmntent ();
 #elif HAVE_GETVFSSTAT || HAVE_GETFSSTAT
        new = cu_mount_getfsstat ();
-#elif HAVE_GEN_GETMNTENT
+#elif HAVE_TWO_GETMNTENT || HAVE_GEN_GETMNTENT || HAVE_SUN_GETMNTENT
        new = cu_mount_gen_getmntent ();
+#elif HAVE_SEQ_GETMNTENT
+# warn "This version of `getmntent' hat not yet been implemented!"
 #elif HAVE_ONE_GETMNTENT
        new = cu_mount_getmntent ();
 #else