author | Marc Fournier <marc.fournier@camptocamp.com> | |
Wed, 8 Jan 2014 17:28:07 +0000 (18:28 +0100) | ||
committer | Marc Fournier <marc.fournier@camptocamp.com> | |
Wed, 8 Jan 2014 17:28:07 +0000 (18:28 +0100) |
Conflicts:
src/zfs_arc.c
src/zfs_arc.c
12 files changed:
diff --git a/configure.ac b/configure.ac
index 00cda83e80217d1a473ed9ff613efb85883a83ea..3b9b8eb77bd221166b937d34b99564cdab726d85 100644 (file)
--- a/configure.ac
+++ b/configure.ac
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"
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 5d1024fbcae80c465fff95941f8d39dc19f03527..5fe43132aa1acd49a37841b8624db513ac5c563a 100644 (file)
#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"
</Type>
<Type apache_requests>
DataSources value
- DSName "count Requests/s"
+ DSName "value Requests/s"
RRDTitle "Apache Traffic"
RRDVerticalLabel "Requests/s"
RRDFormat "%5.2lf"
</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"
</Type>
<Type frequency>
DataSources value
- DSName frequency Frequency
+ DSName value Frequency
RRDTitle "Frequency ({type_instance})"
RRDVerticalLabel "Hertz"
RRDFormat "%4.1lfHz"
</Type>
<Type percent>
DataSources value
- DSName percent Percent
+ DSName value Percent
RRDTitle "Percent ({type_instance})"
RRDVerticalLabel "Percent"
RRDFormat "%4.1lf%%"
</Type>
<Type ping>
DataSources value
- DSName "ping Latency"
+ DSName "value Latency"
RRDTitle "Network latency ({type_instance})"
RRDVerticalLabel "Milliseconds"
RRDFormat "%5.2lfms"
</Type>
<Type users>
DataSources value
- DSName users Users
+ DSName value Users
RRDTitle "Users ({type_instance}) on {hostname}"
RRDVerticalLabel "Users"
RRDFormat "%.1lf"
diff --git a/src/Makefile.am b/src/Makefile.am
index 59454dc09fc12109219593098780f6e5fe29a016..a9d858232a9ec547f42e52d335b1d3e5ff2da5eb 100644 (file)
--- a/src/Makefile.am
+++ b/src/Makefile.am
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
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
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)
diff --git a/src/collectd.c b/src/collectd.c
index d96d676790d0d8c730610484637c9322e2a27b5b..d25975308e9689b15fa9126503f35ed056353a67 100644 (file)
--- a/src/collectd.c
+++ b/src/collectd.c
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);
}
diff --git a/src/collectd.conf.pod b/src/collectd.conf.pod
index 4bd8aac3e81c98d824668399b62f52da64ecdef6..f597c490b410a8c599053954f0745d488d6c02c6 100644 (file)
--- a/src/collectd.conf.pod
+++ b/src/collectd.conf.pod
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
</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
diff --git a/src/curl.c b/src/curl.c
index 280e61c8649ae70a0f2bc99658aeed5659e71e5a..e35b2580a4eb8fe019f1c633f47a71129ca23d41 100644 (file)
--- a/src/curl.c
+++ b/src/curl.c
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 */
diff --git a/src/curl_json.c b/src/curl_json.c
index 6c7cf8d87676399833d25cf9c836c1fdd999f4ab..1ef8a26285a8375f5af8545e0d5e7abea60ca50d 100644 (file)
--- a/src/curl_json.c
+++ b/src/curl_json.c
typedef struct cj_key_s cj_key_t;
struct cj_key_s /* {{{ */
{
+ unsigned long magic;
char *path;
char *type;
char *instance;
- unsigned long magic;
};
/* }}} */
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)
diff --git a/src/interface.c b/src/interface.c
index ea820399ca0652bc7299d2b24ee4dde9c5569ecd..c618af98c0016dacb5950aad50b017c3e0858c34 100644 (file)
--- a/src/interface.c
+++ b/src/interface.c
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);
diff --git a/src/target_replace.c b/src/target_replace.c
index 9a9affb4d3e6ba3841f33f0be7d3d47effade175..1d7af5c35d0b01a98ab1f9170b6e361fa8f41913 100644 (file)
--- a/src/target_replace.c
+++ b/src/target_replace.c
/* && (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;
}
diff --git a/src/target_set.c b/src/target_set.c
index 8a014c3cd50caa156649f6de3093eda7cd7cac77..2fb9cee5665cbb463bcdb87dd1245116543b5587 100644 (file)
--- a/src/target_set.c
+++ b/src/target_set.c
/* && (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;
}
diff --git a/src/types.db b/src/types.db
index 8c72429d3935a99b92f73ffaad9ef75ed8ab1dd0..97cc4cc08ad81a640be9b6550d0435deb447e9ba 100644 (file)
--- a/src/types.db
+++ b/src/types.db
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
diff --git a/src/zfs_arc.c b/src/zfs_arc.c
index 2edba6d1b68d4abc803b06145d6b2f5376503eca..96ffc54957aae84a8fb548e3df352307a9a9d168 100644 (file)
--- a/src/zfs_arc.c
+++ b/src/zfs_arc.c
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);
}
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);
}
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");