Merge branch 'collectd-5.3' into collectd-5.4
authorMarc Fournier <marc.fournier@camptocamp.com>
Wed, 8 Jan 2014 17:28:07 +0000 (18:28 +0100)
committerMarc Fournier <marc.fournier@camptocamp.com>
Wed, 8 Jan 2014 17:28:07 +0000 (18:28 +0100)
Conflicts:
src/zfs_arc.c

12 files changed:
configure.ac
contrib/collection3/etc/collection.conf
src/Makefile.am
src/collectd.c
src/collectd.conf.pod
src/curl.c
src/curl_json.c
src/interface.c
src/target_replace.c
src/target_set.c
src/types.db
src/zfs_arc.c

index 00cda83..3b9b8eb 100644 (file)
@@ -1434,13 +1434,12 @@ AM_CONDITIONAL(BUILD_WITH_LIBKSTAT, test "x$with_kstat" = "xyes")
 AM_CONDITIONAL(BUILD_WITH_LIBDEVINFO, test "x$with_devinfo" = "xyes")
 
 with_libiokit="no"
-AC_CHECK_LIB(IOKit, IOServiceGetMatchingServices,
-[
+if test "x$ac_system" = "xDarwin"
+then
        with_libiokit="yes"
-], 
-[
+else
        with_libiokit="no"
-])
+fi
 AM_CONDITIONAL(BUILD_WITH_LIBIOKIT, test "x$with_libiokit" = "xyes")
 
 with_libkvm="no"
@@ -3060,6 +3059,25 @@ then
        AC_CHECK_HEADERS(pcap-bpf.h,,
                         [with_libpcap="no (pcap-bpf.h not found)"])
 fi
+if test "x$with_libpcap" = "xyes"
+then
+       AC_CACHE_CHECK([whether libpcap has PCAP_ERROR_IFACE_NOT_UP],
+                      [c_cv_libpcap_have_pcap_error_iface_not_up],
+                      AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+[[[
+#include <pcap.h>
+]]],
+[[[
+  int val = PCAP_ERROR_IFACE_NOT_UP;
+]]]
+                      )],
+                      [c_cv_libpcap_have_pcap_error_iface_not_up="yes"],
+                      [c_cv_libpcap_have_pcap_error_iface_not_up="no"]))
+fi
+if test "x$c_cv_libpcap_have_pcap_error_iface_not_up" != "xyes"
+then
+               with_libpcap="no (pcap.h misses PCAP_ERROR_IFACE_NOT_UP)"
+fi
 AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
 # }}}
 
index 5d1024f..5fe4313 100644 (file)
@@ -3,7 +3,7 @@ GraphWidth 400
 #UnixSockAddr "/var/run/collectd-unixsock"
 <Type apache_bytes>
   DataSources value
-  DSName "count Bytes/s"
+  DSName "value Bytes/s"
   RRDTitle "Apache Traffic"
   RRDVerticalLabel "Bytes/s"
   RRDFormat "%5.1lf%s"
@@ -11,7 +11,7 @@ GraphWidth 400
 </Type>
 <Type apache_requests>
   DataSources value
-  DSName "count Requests/s"
+  DSName "value Requests/s"
   RRDTitle "Apache Traffic"
   RRDVerticalLabel "Requests/s"
   RRDFormat "%5.2lf"
@@ -246,14 +246,14 @@ GraphWidth 400
 </Type>
 <Type conntrack>
   DataSources value
-  DSName conntrack Conntrack count
+  DSName value Conntrack count
   RRDTitle "nf_conntrack connections on {hostname}"
   RRDVerticalLabel "Count"
   RRDFormat "%4.0lf"
 </Type>
 <Type entropy>
   DataSources value
-  DSName entropy Entropy bits
+  DSName value Entropy bits
   RRDTitle "Available entropy on {hostname}"
   RRDVerticalLabel "Bits"
   RRDFormat "%4.0lf"
@@ -268,7 +268,7 @@ GraphWidth 400
 </Type>
 <Type frequency>
   DataSources value
-  DSName frequency Frequency
+  DSName value Frequency
   RRDTitle "Frequency ({type_instance})"
   RRDVerticalLabel "Hertz"
   RRDFormat "%4.1lfHz"
@@ -543,7 +543,7 @@ GraphWidth 400
 </Type>
 <Type percent>
   DataSources value
-  DSName percent Percent
+  DSName value Percent
   RRDTitle "Percent ({type_instance})"
   RRDVerticalLabel "Percent"
   RRDFormat "%4.1lf%%"
@@ -551,7 +551,7 @@ GraphWidth 400
 </Type>
 <Type ping>
   DataSources value
-  DSName "ping Latency"
+  DSName "value Latency"
   RRDTitle "Network latency ({type_instance})"
   RRDVerticalLabel "Milliseconds"
   RRDFormat "%5.2lfms"
@@ -701,7 +701,7 @@ GraphWidth 400
 </Type>
 <Type users>
   DataSources value
-  DSName users Users
+  DSName value Users
   RRDTitle "Users ({type_instance}) on {hostname}"
   RRDVerticalLabel "Users"
   RRDFormat "%.1lf"
index 59454dc..a9d8582 100644 (file)
@@ -191,7 +191,7 @@ if BUILD_PLUGIN_APPLE_SENSORS
 pkglib_LTLIBRARIES += apple_sensors.la
 apple_sensors_la_SOURCES = apple_sensors.c
 apple_sensors_la_LDFLAGS = -module -avoid-version
-apple_sensors_la_LIBADD = -lIOKit
+apple_sensors_la_LDFLAGS += -framework IOKit
 collectd_LDADD += "-dlopen" apple_sensors.la
 collectd_DEPENDENCIES += apple_sensors.la
 endif
@@ -223,7 +223,7 @@ battery_la_SOURCES = battery.c
 battery_la_LDFLAGS = -module -avoid-version
 battery_la_LIBADD =
 if BUILD_WITH_LIBIOKIT
-battery_la_LIBADD += -lIOKit
+battery_la_LDFLAGS += -framework IOKit
 endif
 collectd_LDADD += "-dlopen" battery.la
 collectd_DEPENDENCIES += battery.la
@@ -379,7 +379,7 @@ if BUILD_WITH_LIBDEVINFO
 disk_la_LIBADD += -ldevinfo
 endif
 if BUILD_WITH_LIBIOKIT
-disk_la_LIBADD += -lIOKit
+disk_la_LDFLAGS += -framework IOKit
 endif
 if BUILD_WITH_LIBSTATGRAB
 disk_la_CFLAGS += $(BUILD_WITH_LIBSTATGRAB_CFLAGS)  
index d96d676..d259753 100644 (file)
@@ -118,7 +118,7 @@ static int init_hostname (void)
                ERROR ("Looking up \"%s\" failed. You have set the "
                                "\"FQDNLookup\" option, but I cannot resolve "
                                "my hostname to a fully qualified domain "
-                               "name. Please fix you network "
+                               "name. Please fix the network "
                                "configuration.", hostname_g);
                return (-1);
        }
index 4bd8aac..f597c49 100644 (file)
@@ -6382,7 +6382,7 @@ When a value comes within range again or is received after it was missing, an
 Here is a configuration example to get you started. Read below for more
 information.
 
- <Threshold>
+ <Plugin threshold>
    <Type "foo">
      WarningMin    0.00
      WarningMax 1000.00
@@ -6413,7 +6413,7 @@ information.
        </Type>
      </Plugin>
    </Host>
- </Threshold>
+ </Plugin>
 
 There are basically two types of configuration statements: The C<Host>,
 C<Plugin>, and C<Type> blocks select the value for which a threshold should be
index 280e61c..e35b258 100644 (file)
@@ -586,7 +586,8 @@ static void cc_submit (const web_page_t *wp, const web_match_t *wm, /* {{{ */
   sstrncpy (vl.plugin, "curl", sizeof (vl.plugin));
   sstrncpy (vl.plugin_instance, wp->instance, sizeof (vl.plugin_instance));
   sstrncpy (vl.type, wm->type, sizeof (vl.type));
-  sstrncpy (vl.type_instance, wm->instance, sizeof (vl.type_instance));
+  if (wm->instance != NULL)
+    sstrncpy (vl.type_instance, wm->instance, sizeof (vl.type_instance));
 
   plugin_dispatch_values (&vl);
 } /* }}} void cc_submit */
index 6c7cf8d..1ef8a26 100644 (file)
@@ -53,10 +53,10 @@ struct cj_key_s;
 typedef struct cj_key_s cj_key_t;
 struct cj_key_s /* {{{ */
 {
+  unsigned long magic;
   char *path;
   char *type;
   char *instance;
-  unsigned long magic;
 };
 /* }}} */
 
@@ -549,6 +549,7 @@ static int cj_config_add_key (cj_t *db, /* {{{ */
         len = ptr-name;
         if (len == 0)
           break;
+        len = COUCH_MIN(len, sizeof (ent)-1);
         sstrncpy (ent, name, len+1);
 
         if (c_avl_get (tree, ent, (void *) &value) != 0)
index ea82039..c618af9 100644 (file)
@@ -213,18 +213,19 @@ static int interface_read (void)
 
        for (if_ptr = if_list; if_ptr != NULL; if_ptr = if_ptr->ifa_next)
        {
-               if ((if_data = (struct IFA_DATA *) if_ptr->ifa_data) == NULL)
-                       continue;
+               if (if_ptr->ifa_addr != NULL && if_ptr->ifa_addr->sa_family == AF_LINK) {
+                       if_data = (struct IFA_DATA *) if_ptr->ifa_data;
 
-               if_submit (if_ptr->ifa_name, "if_octets",
+                       if_submit (if_ptr->ifa_name, "if_octets",
                                if_data->IFA_RX_BYTES,
                                if_data->IFA_TX_BYTES);
-               if_submit (if_ptr->ifa_name, "if_packets",
+                       if_submit (if_ptr->ifa_name, "if_packets",
                                if_data->IFA_RX_PACKT,
                                if_data->IFA_TX_PACKT);
-               if_submit (if_ptr->ifa_name, "if_errors",
+                       if_submit (if_ptr->ifa_name, "if_errors",
                                if_data->IFA_RX_ERROR,
                                if_data->IFA_TX_ERROR);
+               }
        }
 
        freeifaddrs (if_list);
index 9a9affb..1d7af5c 100644 (file)
@@ -296,8 +296,8 @@ static int tr_create (const oconfig_item_t *ci, void **user_data) /* {{{ */
         /* && (data->type == NULL) */
         && (data->type_instance == NULL))
     {
-      ERROR ("Target `replace': You need to set at lease one of `Host', "
-          "`Plugin', `PluginInstance', `Type', or `TypeInstance'.");
+      ERROR ("Target `replace': You need to set at least one of `Host', "
+          "`Plugin', `PluginInstance' or `TypeInstance'.");
       status = -1;
     }
 
index 8a014c3..2fb9cee 100644 (file)
@@ -171,8 +171,8 @@ static int ts_create (const oconfig_item_t *ci, void **user_data) /* {{{ */
         /* && (data->type == NULL) */
         && (data->type_instance == NULL))
     {
-      ERROR ("Target `set': You need to set at lease one of `Host', "
-          "`Plugin', `PluginInstance', `Type', or `TypeInstance'.");
+      ERROR ("Target `set': You need to set at least one of `Host', "
+          "`Plugin', `PluginInstance' or `TypeInstance'.");
       status = -1;
     }
 
index 8c72429..97cc4cc 100644 (file)
@@ -13,7 +13,7 @@ cache_eviction                value:DERIVE:0:U
 cache_operation                value:DERIVE:0:U
 cache_ratio            value:GAUGE:0:100
 cache_result           value:DERIVE:0:U
-cache_size             value:GAUGE:0:4294967295
+cache_size             value:GAUGE:0:U
 charge                 value:GAUGE:0:U
 compression_ratio      value:GAUGE:0:2
 compression            uncompressed:DERIVE:0:U, compressed:DERIVE:0:U
index 2edba6d..96ffc54 100644 (file)
@@ -99,7 +99,7 @@ static int za_read_derive (kstat_t *ksp, const char *kstat_value,
   tmp = get_zfs_value (ksp, (char *)kstat_value);
   if (tmp == -1LL)
   {
-    ERROR ("zfs_arc plugin: Reading kstat value \"%s\" failed.", kstat_value);
+    WARNING ("zfs_arc plugin: Reading kstat value \"%s\" failed.", kstat_value);
     return (-1);
   }
 
@@ -117,7 +117,7 @@ static int za_read_gauge (kstat_t *ksp, const char *kstat_value,
   tmp = get_zfs_value (ksp, (char *)kstat_value);
   if (tmp == -1LL)
   {
-    ERROR ("zfs_arc plugin: Reading kstat value \"%s\" failed.", kstat_value);
+    WARNING ("zfs_arc plugin: Reading kstat value \"%s\" failed.", kstat_value);
     return (-1);
   }
 
@@ -161,9 +161,11 @@ static int za_read (void)
        za_read_gauge (ksp, "l2_size", "cache_size", "L2");
 
        /* Operations */
-       za_read_derive (ksp, "allocated","cache_operation", "allocated");
        za_read_derive (ksp, "deleted",  "cache_operation", "deleted");
+#if __FreeBSD__
+       za_read_derive (ksp, "allocated","cache_operation", "allocated");
        za_read_derive (ksp, "stolen",   "cache_operation", "stolen");
+#endif
 
        /* Issue indicators */
        za_read_derive (ksp, "mutex_miss", "mutex_operations", "miss");