From: Marc Fournier Date: Sat, 27 Feb 2016 22:10:11 +0000 (+0100) Subject: Merge pull request #1555 from falzm/extend-interface X-Git-Tag: collectd-5.6.0~469 X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=ef6955ee8e0d4790675cc301b47b3f45d4d634b6;hp=b13246861a25336f8f645752fe111a9a82e470f1;p=collectd.git Merge pull request #1555 from falzm/extend-interface Report packets dropped in interface plugin --- diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..25241b1b --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,38 @@ +# Thanks ! + +Thanks for your feedback & contributions to the +[collectd project](https://collectd.org/) ! + +## Need help using collectd ? + +Please use the +[collectd mailing list](http://mailman.verplant.org/listinfo/collectd) or the +[#collectd IRC channel](https://webchat.freenode.net/?channels=#collectd). +We'd like to keep the github issue tracker for bugreports and patch reviews. + +## Found a bug ? + +Please mention the exact collectd version you're using, how you installed it +(built from source, or installed from packages. Where did you download it +from). Which operating system/architecture, distribution and version are you +running collectd on. + +If collectd crashes, try to get a +[stack trace](https://collectd.org/wiki/index.php/Core_file). + +## Fixed a bug ? Want to add a feature ? + +Using git/github to submit changes is not mandatory. Sending patches to the +[mailing-list](http://mailman.verplant.org/listinfo/collectd) is also fine. +In both cases, take a quick look at the +[submission guidelines](https://collectd.org/wiki/index.php/Submitting_patches) +and the [coding style recommendations](https://collectd.org/wiki/index.php/Coding_style). + +Please try to submit **bugfixes** to the +[oldest release branch](https://github.com/collectd/collectd/milestones) on +which the bug is found, so that it gets included in every future **bugfix +release**. + +Please try to submit **new features** to the master branch (which will become +the next **feature release**). + diff --git a/configure.ac b/configure.ac index fc1e11c1..d859fc1a 100644 --- a/configure.ac +++ b/configure.ac @@ -44,6 +44,7 @@ AC_SYS_LARGEFILE # AC_PROG_CC AC_PROG_CPP +AC_PROG_EGREP AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET @@ -60,6 +61,18 @@ m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-conf PKG_PROG_PKG_CONFIG +AC_CACHE_CHECK([if bison is the parser generator], + [collectd_cv_prog_bison], + [AS_IF([$YACC --version 2>/dev/null | $EGREP -q '^bison '], + [collectd_cv_prog_bison=yes], [collectd_cv_prog_bison=no] + )] +) + +if test "x$collectd_cv_prog_bison" = "xno" && test ! -f "${srcdir}/liboconfig/parser.c" +then + AC_MSG_ERROR([bison is missing and you do not have ${srcdir}/liboconfig/parser.c. Please install bison]) +fi + AC_CHECK_PROG([have_protoc_c], [protoc-c], [yes], [no]) if test "x$have_protoc_c" = "xno" then @@ -99,6 +112,10 @@ case $host_os in AC_DEFINE([KERNEL_OPENBSD], 1, [True if program is to be compiled for an OpenBSD kernel]) ac_system="OpenBSD" ;; + *netbsd*) + AC_DEFINE([KERNEL_NETBSD], 1, [True if program is to be compiled for a NetBSD kernel]) + ac_system="NetBSD" + ;; *aix*) AC_DEFINE([KERNEL_AIX], 1, [True if program is to be compiled for a AIX kernel]) ac_system="AIX" @@ -186,6 +203,19 @@ AC_HEADER_STDBOOL AC_CHECK_HEADERS(stdio.h errno.h math.h stdarg.h syslog.h fcntl.h signal.h assert.h sys/types.h sys/socket.h sys/select.h poll.h netdb.h arpa/inet.h sys/resource.h sys/param.h kstat.h regex.h sys/ioctl.h endian.h sys/isa_defs.h fnmatch.h libgen.h) +# For entropy plugin on newer NetBSD +AC_CHECK_HEADERS(sys/rndio.h, [], [], +[#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_IOCTL_H +# include +#endif +#if HAVE_SYS_PARAM_H +# include +#endif +]) + # For ping library AC_CHECK_HEADERS(netinet/in_systm.h, [], [], [#if HAVE_STDINT_H @@ -413,6 +443,22 @@ else AC_MSG_RESULT([no]) fi +AC_MSG_CHECKING([for sysctl kern.cp_time]) +if test -x /sbin/sysctl +then + /sbin/sysctl kern.cp_time >/dev/null 2>&1 + if test $? -eq 0 + then + AC_MSG_RESULT([yes]) + AC_DEFINE(HAVE_SYSCTL_KERN_CP_TIME, 1, + [Define if sysctl supports kern.cp_time]) + else + AC_MSG_RESULT([no]) + fi +else + AC_MSG_RESULT([no]) +fi + # For hddtemp module AC_CHECK_HEADERS(linux/major.h) @@ -1437,6 +1483,24 @@ AC_CHECK_MEMBERS([struct kinfo_proc.p_pid, struct kinfo_proc.p_vm_rssize], #include ]) + +AC_CHECK_MEMBERS([struct kinfo_proc2.p_pid, struct kinfo_proc2.p_uru_maxrss], + [ + AC_DEFINE(HAVE_STRUCT_KINFO_PROC2_NETBSD, 1, + [Define if struct kinfo_proc2 exists in the NetBSD variant.]) + have_struct_kinfo_proc2_netbsd="yes" + ], + [ + have_struct_kinfo_proc2_netbsd="no" + ], + [ +#include +#include +#include + ]) + + + AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [], [#define _BSD_SOURCE #define _DEFAULT_SOURCE @@ -5369,6 +5433,14 @@ then plugin_tcpconns="yes" fi +if test "x$ac_system" = "xNetBSD" +then + plugin_entropy="yes" + plugin_irq="yes" + plugin_processes="yes" + plugin_disk="yes" +fi + # Mac OS X devices if test "x$with_libiokit" = "xyes" then @@ -5615,6 +5687,11 @@ then plugin_swap="yes" fi +if test "x$have_swapctl" = "xyes" && test "x$c_cv_have_swapctl_three_args" = "xyes" +then + plugin_swap="yes" +fi + if test "x$with_kvm_openfiles$with_kvm_nlist" = "xyesyes" then plugin_tcpconns="yes" diff --git a/src/apache.c b/src/apache.c index b306032b..38035caa 100644 --- a/src/apache.c +++ b/src/apache.c @@ -530,13 +530,16 @@ static int apache_read_host (user_data_t *user_data) /* {{{ */ st = user_data->data; + int status; + + char *content_type; + static const char *text_plain = "text/plain"; + assert (st->url != NULL); /* (Assured by `config_add') */ if (st->curl == NULL) { - int status; - status = init_host (st); if (status != 0) return (-1); @@ -559,6 +562,16 @@ static int apache_read_host (user_data_t *user_data) /* {{{ */ st->server_type = APACHE; } + status = curl_easy_getinfo (st->curl, CURLINFO_CONTENT_TYPE, &content_type); + if ((status == CURLE_OK) && (content_type != NULL) && + (strncasecmp (content_type, text_plain, strlen (text_plain)) != 0)) + { + WARNING ("apache plugin: `Content-Type' response header is not `%s' " + "(received: `%s'). Expecting unparseable data. Please check `URL' " + "parameter (missing `?auto' suffix ?)", + text_plain, content_type); + } + ptr = st->apache_buffer; saveptr = NULL; while ((line = strtok_r (ptr, "\n\r", &saveptr)) != NULL) diff --git a/src/collectd.conf.in b/src/collectd.conf.in index 953b5e4c..f57241da 100644 --- a/src/collectd.conf.in +++ b/src/collectd.conf.in @@ -84,7 +84,7 @@ # Lines beginning with a single `#' belong to plugins which have been built # # but are disabled by default. # # # -# Lines begnning with `##' belong to plugins which have not been built due # +# Lines beginning with `##' belong to plugins which have not been built due # # to missing dependencies or because they have been deactivated explicitly. # ############################################################################## diff --git a/src/modbus.c b/src/modbus.c index d2b0a535..d538fb3f 100644 --- a/src/modbus.c +++ b/src/modbus.c @@ -310,7 +310,9 @@ static int mb_init_connection (mb_host_t *host) /* {{{ */ if (host == NULL) return (EINVAL); +#if COLLECT_DEBUG modbus_set_debug (&host->connection, 1); +#endif /* We'll do the error handling ourselves. */ modbus_set_error_handling (&host->connection, NOP_ON_ERROR); @@ -390,7 +392,9 @@ static int mb_init_connection (mb_host_t *host) /* {{{ */ } } +#if COLLECT_DEBUG modbus_set_debug (host->connection, 1); +#endif /* We'll do the error handling ourselves. */ modbus_set_error_recovery (host->connection, 0);