matrix:
include:
- os: osx
- osx_image: xcode10.1
+ osx_image: xcode11.2
compiler: clang
+ jdk: openjdk10
env:
- CXX=clang++
- PATH="/usr/local/opt/mysql-client/bin:$PATH"
+ - JAVA_HOME="/Library/Java/JavaVirtualMachines/openjdk-13.jdk/Contents/Home"
- os: linux
dist: xenial
compiler: clang
+ jdk: openjdk10
- os: linux
dist: xenial
compiler: gcc
+ jdk: openjdk10
before_install:
# When building the coverity_scan branch, allow only the first job to continue to avoid travis-ci/travis-ci#1975.
script:
- if [[ "${TRAVIS_BRANCH}" == "coverity_scan" ]]; then exit 0; fi
+ - type pkg-config
+ - pkg-config --list-all | sort -u
- ./configure
+ - cat config.log
- make distcheck DISTCHECK_CONFIGURE_FLAGS="--disable-dependency-tracking --enable-debug"
addons:
- liblua50-dev
- liblua5.1-0-dev
- liblua5.2-dev
- - liblvm2-dev
- libmemcached-dev
- libmicrohttpd-dev
- libmnl-dev
- libsensors4-dev
- libsigrok-dev
- libsnmp-dev
- - libstatgrab-dev
- libtokyocabinet-dev
- libtokyotyrant-dev
- libudev-dev
packages:
- curl
- glib
+ - grpc
- hiredis
- libdbi
- libmemcached
- liboping
- libpcap
- librdkafka
- - libstatgrab
- libvirt
+ - libxml2
- lua
+ - mongo-c-driver
- mosquitto
- mysql-client
- net-snmp
+2019-10-01, Version 5.9.2
+ * syslog plugin: Don't fail if syslog loglevel doesn't match. Thanks to
+ Fabien Wernli. #3236 #3238
+ * collectd: Fix ssnprintf wrapper. Thanks to Fabien Wernli. #3237
+ * rdt plugin: Fix compile time issues. Thanks to Matthias Runge. #3245
+
+2019-07-24, Version 5.9.1
+ * collectd: redhat spec: fix build due to new upstream plugins. Thanks
+ to Fabien Wernli. #3175
+ * collectd: regex match: Fix unexpected match with empty meta data .
+ Thanks to Takuro Ashie. #3178
+ * collectd: Fix return value or loglevel for several plugins. Thanks to
+ Fabien Wernli. #3182
+ * collectd: Add standard include early or _FILE_OFFSET_BITS will have
+ definition … . Thanks to Dagobert Michelsen. #3193
+ * collectd: Use GCC-specific flags only when compiling with GCC. Thanks
+ to Dagobert Michelsen. #3195
+ * Use test_utils_proc_pids only when compiling the plugin that uses it.
+ Thanks to Dagobert Michelsen. #3197
+ * DNS plugin: Do not use headers from glibc. Thanks to Pavel Rochnyak.
+ #3156, #3145
+ * collectd: Add missing definitions for libnetsnmpagent. Thanks to
+ Dagobert Michelsen. #3203
+ * collectd: Move Makefile rules for pid_test inside conditional for
+ code. Thanks to Dagobert Michelsen. #3206
+ * collectd: Recover setlocale() call in src/daemon/collectd.c do_init().
+ Thanks to Pavel Rochnyak. #3214, #3181
+ * collectd: Add snprintf wrapper for GCC 8.2/3. Thanks to zebity. #3153,
+ #2895, #3038
+ * collectd: Fix bug that leads to CPPFLAGS gets overridden with CFLAGS
+ when libxmms is enabled. Thanks to Dagobert Michelsen. #3207
+ * Write_Riemann plugin: Copy MetaData to Riemann events in
+ write_riemann. Thanks to Romain Tartière. #3158
+ * virt plugin: Fix memory leak with libvirt MetadataXPath enabled.
+ Thanks to Pavel Rochnyak. #3225, #3230
+
+2019-06-13, Version 5.9.0
+ * Build System: configure.ac: option "--with-libxml2" has been added.
+ Thanks to Dimitrios Apostolou, Pavel Rochnyak. #2864
+ * Build System: configure.ac: run dpdk build tests only if pkgconfig
+ fails. Thanks to Luca Boccassi, Pavel Rochnyak. #3015
+ * Build System: The "df" plugin is now built when "getmntent_r()" is
+ available. Thanks to Florian Forster. #3095
+ * Build System: The ability to turn on collectd "debug" feature in RPMs
+ has been added. Thanks to dehotot. #2755
+ * collectd: A new "UNKNOWN" state as the initial state of metrics has
+ been added. Thanks to Luis Fernández Álvarez, Florian Forster. #2976
+ * collectd: Base port to Windows. Thanks to Sean Campbell. #2810
+ * collectd: Code ownership of five plugins has been handed out to folks
+ from Intel. Thanks to Florian Forster. #3053
+ * collectd: config parser: Improved error reporting on global options.
+ Thanks to Pavel Rochnyak. #2813
+ * collectd: daemon: make plugin_dispatch_multivalue() obey write queue
+ limits. Thanks to Adam Romanek. #2898
+ * collectd: Macros "STRERROR" and "STRERRNO" have been added. Thanks to
+ Florian Forster. #2519
+ * collectd: Plugin name field has been added to plugin context to
+ improve error reporting. Thanks to Pavel Rochnyak. #2821
+ * collectd-tg: Use "CLOCK_REALTIME" for collectd-tg times. Thanks to
+ Andrew Bays. #2837
+ * tree-wide: Don't initialize static pointers to NULL, use "bool" from
+ "stdbool.h" (instead of "_Bool"). Thanks to Ruben Kerkhof. #2771,
+ #2772
+ * tree-wide: Replace zu with "PRIsz" and llu with "PRIu64". Thanks to
+ Sean Campbell. #2512
+ * tree-wide: Use interval value from plugin context, do not set
+ "vl->interval" in plugins more. Thanks to Pavel Rochnyak. #2847
+ * tree-wide: Utilities and libraries have been moved to "src/utils/".
+ Thanks to Florian Forster. #2961
+ * AMPQ1 plugin: A new plugin to write to amqp1 protocol. Thanks to Andy
+ Smith. #2618
+ * Chrony plugin: Ignoring late responses has been added. Thanks to
+ Miroslav Lichvar, Pavel Rochnyak. #2896
+ * CPUFreq plugin: Read number of p-state transitions and time spent in
+ each p-state. Thanks to Sexton Rory. #2803
+ * cURL, cURL-XML plugins: Option "Interval" has been added. Thanks to
+ Pavel Rochnyak. #2847
+ * Disk plugin: Report number of in progress disk IO requests on FreeBSD.
+ Thanks to Nathan Huff. #2878
+ * Exec plugin: Dynamic allocation of grname buffer has been added.
+ Thanks to sreedi, Florian Forster. #2937
+ * GPU NVML plugin: New plugin to collect NVIDIA GPU stats. Thanks to
+ Evgeny Naumov. #2923
+ * gRPC plugin: The "VerifyPeer" option for servers has been added.
+ Thanks to Florian Forster. #2593
+ * Intel RDT plugin: Support for groups of PIDs has been added. Thanks to
+ Wojciech Andralojc, Mateusz Starzyk, Michal Aleksinski. #2891
+ * IPMI plugin: Config options "SELSensor" and "SELIgnoreSelected" have
+ been added. Thanks to Mariusz Szafranski. #2796
+ * Modbus plugin: Support for 64 bit vals has been added, support for
+ CDAB endian 32-bit modbus polls has been added. Thanks to Anthony
+ Vickers, PJ Bostley. #2670, #2660
+ * Modbus plugin: The "Scale" and "Shift" metrics have been added. Thanks
+ to cekstam. #2729
+ * Netlink plugin: Handle new counter from Linux kernel version 4.6+.
+ Thanks to Pavel Rochnyak. #2767
+ * Network plugin: Option "BindAddress" has been added. Thanks to Ofir
+ Hermesh. #2831
+ * Ping plugin: An "AddressFamily" configuration option has been added.
+ Thanks to 依云 lilydjwg. #2961
+ * OVS Stats plugin: Extended metrics "ovs-dpdk" have been added. Thanks
+ to Matteo Croce, Ryan McCabe. #3000
+ * OVS Stats plugin: Support of bond interface and a "InterfaceStats"
+ config option have been added. Thanks to Andrew Bays. #2880
+ * PCIe Errors plugin: New plugin to read "PCIe" errors. Thanks to Kamil
+ Wiatrowski. #2733
+ * Processes plugin: Support for Linux Delay Accounting has been added.
+ Thanks to Florian Forster. #2598
+ * Redis plugin: Keyspace "hitratio" metric has been added, metric
+ "operations_per_second" has been removed, an option for connecting via
+ UNIX socket has been added. Thanks to Pavel Rochnyak. #2838, #2845,
+ #2904
+ * RouterOS plugin: Support for temperature and voltage data has been
+ added, use MAC-address when Radio-name is missing. Thanks to Pavel
+ Rochnyak. #2851, #2854
+ * RRDCacheD plugin: Time resolution has been improved to microseconds.
+ Thanks to Brian T. O'Neill. #3065
+ * Sensors plugin: Checks for upper limit of "SENSORS_API_VERSION" have
+ been removed, support for libsensors older than 3.0.0 has been
+ dropped. Thanks to Pavel Rochnyak. #3013, #3014
+ * SNMP plugin: New options "PluginInstance", "TypeInstance",
+ "TypeInstanceOID", "PluginInstanceOID", "FilterOID", "FilterValues"
+ and "FilterIgnoreSelected" have been added. Thanks to Pavel Rochnyak.
+ #2817, #2819
+ * SNMP Agent plugin: Multiple key indexes to snmp table and other new
+ features have been added, refactoring, coverity scan issues have been
+ fixed. Thanks to Marcin Mozejko. #2702, #2844
+ * Swap plugin: Support for Linux 2.4 has been dropped. Thanks to Pavel
+ Rochnyak. #2979
+ * Turbostat plugin: Configuration option "RestoreAffinityPolicy" has
+ been added. Thanks to Pablo Llopis. #2627
+ * Turbostat plugin: New metrics "P-states", "Turboboost", "Platform
+ TDP", "Uncore bus ratio" have been added. Thanks to Sexton Rory. #2806
+ * Turbostat plugin: Support of reporting GPU power on SKL has been
+ added. Thanks to Gordon Kelly. #2605
+ * virt plugin: Allow read "Hostname" from libvirt metadata. Thanks to
+ Mehdi ABAAKOUK. #2807
+ * virt plugin: Block info statistics for disk devices have been added.
+ Thanks to Radoslaw Jablonski. #2874
+ * Wireless plugin: A "bitrate" metric has been added. Thanks to Florian
+ Forster. #2950
+ * Write Graphite, Write Kafka plugins: Support for Graphite 1.1+ tag has
+ been added. Thanks to Dan Cech. #2631
+ * Write Prometheus plugin: Option "Host" has been added. Thanks to Pavel
+ Rochnyak. #2969
+ * Write Stackdriver plugin: New plugin to write to Google Stackdriver
+ Monitoring. Thanks to Florian Forster. #2472
+ * Write Syslog plugin: "write_syslog" plugin writes values lists as
+ syslog messages. Thanks to Shirly Radco. #3019
+ * Build System: A warning that pkgdatadir and pkglibdir were previously
+ defined has been fixed, additional plugins have been enabled,
+ GNULIB_DIR has been added to LDFLAGS in configure.ac on Windows.
+ Thanks to Sean Campbell. #2907, #2885, #2882
+ * Build System: Including "utils/mount/mount.h" has been fixed. Thanks
+ to Florian Forster. #3097
+ * Build System: The amount of output from ./configure has been reduced,
+ rendering of collectd-lua(5) manpage has been fixed, don't hide errors
+ when creating manpage. Thanks to Ruben Kerkhof. #3086, #3088, #3092
+ * collectd: A bug in "c_avl_iterator_prev" has been fixed. Thanks to
+ volth. #2917
+ * collectd: A stringop compiler warning has been fixed. Thanks to Ruben
+ Kerkhof, Juan Osorio Robles. #3021
+ * collectd: An invalid memory access in the "strjoin()" function has
+ been fixed. Thanks to Florian Forster. #3063
+ * collectd: collectd binary has been refactored. Thanks to Sean
+ Campbell, Sebastian Harl. #2745
+ * collectd: collectdmon cannot exit command line options parse loop has
+ been fixed. Thanks to takahashi-tsc. #2774
+ * collectd: Endianness checks for AIX have been added, gcc issue on Mac
+ byteorder has been fixed, fallback for endianness conversion has been
+ added. Thanks to Dagobert Michelsen. #2761, #2741, #2717
+ * collectd: Handle failure of simple config callbacks. Thanks to Ruben
+ Kerkhof. #3085
+ * collectd: Include "kstat.h" if available to provide "kstat_ctl_t",
+ include "kstat.h" when available. Thanks to Dagobert Michelsen. #2716,
+ #2711
+ * collectd: Parsing option for avoiding making BaseDir has been fixed.
+ Thanks to Mariusz Białończyk. #2856
+ * collectd: Remove empty "cmd_listval_t" data structure and related
+ no-op code. Thanks to Pavel Rochnyak. #2779
+ * collectd: src/daemon/plugin.c: Refactor plugin_load_file(),
+ src/utils_format_json.c: Remove chatty debug messages. Thanks to
+ Florian Forster. #2558, #2938
+ * collectd: Stop poisoning function in debug mode. Thanks to Ruben
+ Kerkhof. #2804
+ * collectd: The number of allocations when parsing types.db has been
+ reduced. Thanks to Ruben Kerkhof. #3091
+ * collectd: The organization of the source repository has been improved.
+ Thanks to Florian Forster. #2961
+ * collectd: Typos have been fixed. Thanks to Florian Forster, Jakub
+ Jankowski, William Pursell. #2944, #2692, #2643
+ * tree-wide: cleanup: cf_util_get* instead of local copy in plugins,
+ prefixed error reporting. Thanks to Pavel Rochnyak. #2833
+ * tree-wide: Some style issues have been fixed. Thanks to Ruben Kerkhof.
+ #3022
+ * tree-wide: "sstrerror()" has been replaced with "STRERRNO". Thanks to
+ Pavel Rochnyak. #2735
+ * AMQP1 plugin: Potential memory leaks found via scan-build have been
+ fixed, a typo in error log message has been fixed, cleanups. Thanks to
+ Andy Smith, Andrew Bays, Ruben Kerkhof. #2802, #2876, #2797
+ * Barometer plugin: Support to "libi2c-4.0" has been added. Thanks to
+ Pavel Rochnyak. #2783
+ * DBI, Oracle, PostgreSQL plugins: Fixes and improvements. Thanks to
+ Pavel Rochnyak. #1705
+ * Disk plugin: "HAVE_UDEV_H" has been changed to "HAVE_LIBUDEV_H".
+ Thanks to Dylan Stephano-Shachter. #2668
+ * Disk plugin: In linux, reset the disk when it disappears from
+ "/proc/diskstats". Thanks to Nikita Kozlov, Pavel Rochnyak. #2551
+ * DPDK Events, DPDK Stats plugins: Buffer size for parsing lcores has
+ been increased, a deprecation warning has been fixed, runtime config
+ file path has been fixed. Thanks to Kevin Laatz. #2722, #2840, #2924
+ * DPDK Stats plugin: A compilation issue has been fixed. Thanks to
+ Volodymyr Mytnyk. #2524
+ * GPS plugin: Build with gpsd version 3.18 has been fixed. Thanks to
+ Baruch Siach. #2947
+ * Intel RDT plugin: Compiler warnings have been fixed. Thanks to Ruben
+ Kerkhof. #3104
+ * Log Logstash plugin: Non-portable struct initialization with "{}" has
+ been fixed. Thanks to Florian Forster. #2988
+ * LUA plugin: A memory leak has been fixed. Thanks to Ruben Kerkhof.
+ #3090
+ * MySQL plugin: Properly cleanup dropped MySQL connections. Thanks to
+ Dhrupad Bhardwaj. #2704
+ * Netlink plugin: Truncation warnings have been fixed. Thanks to Ruben
+ Kerkhof. #2777
+ * NFS plugin: Message "Unexpected number of fields for NFSv4 server
+ statistics: 62" has been fixed. Thanks to Yedidyah Bar David. #2076
+ * NFS plugin: Number of fields for "NFSv4" has been fixed. Thanks to
+ Jan-Philipp Litza. #2915
+ * Notify Email plugin: All notification parameters have been included
+ into email. Thanks to Pavel Rochnyak. #2834
+ * NTPd plugin: Don't treat normal peers as refclocks, skip "0.0.0.0"
+ hosts in ntpd plugin. Thanks to Pavel Rochnyak, Ivan Kurnosov. #2822,
+ #2376
+ * OAuth plugin: src/utils_oauth.c: Renew OAuth tokens 30 seconds before
+ they expire. Thanks to Florian Forster. #2970
+ * OVS Stats plugin: A macro to populate counters list has been added,
+ value of "OpenFlow" has been corrected. Thanks to Matteo Croce. #2966,
+ #2963
+ * OVS Stats plugin: Code style, cleanup and improvements. Thanks to
+ Pavel Rochnyak. #3011, #3012
+ * OVS Stats, OVS Events plugins: utils_ovs: Avoid potential access of
+ freed memory, fixes. Thanks to Ciara Loftus, Mark Kavanagh. #2801,
+ #2731
+ * Processes plugin: Compilation has been fixed when ps_delay() is not
+ used. Thanks to Pavel Rochnyak. #2610
+ * Python plugin: A compilation warning with Python 3.7 has been fixed.
+ Thanks to Manoj Srivastava. #3042
+ * Redis plugin: Bugfixes, extended error reporting, persistent
+ connections and parallel polling, ability to select db for queries has
+ been fixed. Thanks to Pavel Rochnyak, skob. #2826, #2789
+ * Router OS plugin: Unset radio-name showing up as "(null)" has been
+ fixed. Thanks to melak. #2740
+ * RRDCacheD plugin: Cleanup rrdcached plugin a bit. Thanks to Pavel
+ Rochnyak. #3080
+ * RRDTool plugin: Error reporting has been extended. Thanks to Pavel
+ Rochnyak. #2825
+ * Sensors plugin: Support for humidity sensors has been added. Thanks to
+ Sarah Fischmann. #2913
+ * Sensu, OVS Stat, Turbostat, virt, OAuth, Write Prometheus, Intel RDT
+ plugins: Compiler warnings have been fixed. Thanks to Ruben Kerkhof.
+ #3093, #3098, #3099, #3100, #3102, #3103, #3104
+ * virt plugin: Code "do {} while(0)" around macro has been removed.
+ Thanks to Florian Forster. #2579
+ * virt plugin: Compiler warnings, a segfault in libvirt, typo in error
+ messages have been fixed. Thanks to Antoine Naud, Ruben Kerkhof, sarah
+ niuxu18. #2808, #2919, #2957
+ * virt plugin: Optional "virDomainGetCPUStats()" has been removed from
+ main flow, cleanup. Thanks to Pavel Rochnyak. #2972, #2978
+ * virt plugin: Tracking of VM state changes has been fixed. Thanks to
+ Radoslaw Jablonski. #2701
+ * Write MongoDB plugin: Plugin dependencies have been fixed. Thanks to
+ Pavel Rochnyak. #3010
+ * Write Prometheus plugin: A compilation issue on Mac OS X has been
+ fixed. Thanks to Florian Forster. #3059
+ * Write Redis plugin: Bug ""max_set_duration" deletes unexpected data"
+ has been fixed. Thanks to takahashi-tsc. #2773
+ * Write Stackdriver plugin: Potential NULL dereference and error
+ reporting have been fixed. Thanks to Florian Forster. #2960
+ * collectd.conf(5): a typo has been fixed, the tail plugin's
+ documentation has been improved. Thanks to Ruben Kerkhof, Florian
+ Forster. #3087, #2994
+ * collectd.conf.pod: virt: "Instances" option has been documented, a
+ clarifying example has been added. Thanks to Pavel Rochnyak, Fabien
+ Wernli. #2990, #2903
+ * collectd-python: "Import" configuration option has been documented.
+ Thanks to Tyler Harper. #2985
+ * collectd-snmp.pod: Document thread usage correctly. Thanks to Nathan
+ Ward. #3078
+ * CONTRIBUTING.md: Improve wording around ChangeLog; fix example,
+ document the new change log requirement / behavior. Thanks to Florian
+ Forster. #3061, #3054
+ * docs/review_comments.md: document with frequent review comments has
+ been started. Thanks to Florian Forster. #2964
+ * README: Include compiler defenses suggestion, do not point users to
+ non-existing file. Thanks to Kevin Laatz, Ruben Kerkhof. #2721, #2045
+
2018-10-23, Version 5.8.1
* collectd: Fix "BaseDir" option. Thanks to Mariusz Białończyk and
Pavel Rochnyak. #2857
libheap.la \
libignorelist.la \
liblatency.la \
+ libllist.la \
liblookup.la \
libmetadata.la \
libmount.la \
src/daemon/utils_cache.h \
src/daemon/utils_complain.c \
src/daemon/utils_complain.h \
- src/daemon/utils_llist.c \
- src/daemon/utils_llist.h \
src/daemon/utils_random.c \
src/daemon/utils_random.h \
src/daemon/utils_subst.c \
libavltree.la \
libcommon.la \
libheap.la \
+ libllist.la \
liboconfig.la \
-lm \
$(COMMON_LIBS) \
src/utils/ignorelist/ignorelist.c \
src/utils/ignorelist/ignorelist.h
+libllist_la_SOURCES = \
+ src/daemon/utils_llist.c \
+ src/daemon/utils_llist.h
+
libmetadata_la_SOURCES = \
src/utils/metadata/meta_data.c \
src/utils/metadata/meta_data.h
lua_la_LIBADD = $(BUILD_WITH_LIBLUA_LIBS)
endif
-if BUILD_PLUGIN_LVM
-pkglib_LTLIBRARIES += lvm.la
-lvm_la_SOURCES = src/lvm.c
-lvm_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBLVM2APP_CPPFLAGS)
-lvm_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBLVM2APP_LDFLAGS)
-lvm_la_LIBADD = $(BUILD_WITH_LIBLVM2APP_LIBS)
-endif
-
if BUILD_PLUGIN_MADWIFI
pkglib_LTLIBRARIES += madwifi.la
madwifi_la_SOURCES = \
libplugin_mock.la \
libmetadata.la \
$(GCRYPT_LIBS)
+if BUILD_WITH_LIBSOCKET
+test_plugin_network_LDADD += -lsocket
+endif
+if BUILD_WITH_LIBNSL
+test_plugin_network_LDADD += -lnsl
+endif
check_PROGRAMS += test_plugin_network
endif
collectd without the need to start a heavy interpreter every interval.
See collectd-lua(5) for details.
- - lvm
- Size of “Logical Volumes” (LV) and “Volume Groups” (VG) of Linux'
- “Logical Volume Manager” (LVM).
-
- madwifi
Queries very detailed usage statistics from wireless LAN adapters and
interfaces that use the Atheros chipset and the MadWifi driver.
Used by the `lua' plugin. Currently, Lua 5.1 and later are supported.
<https://www.lua.org/>
- * liblvm2 (optional)
- Used by the `lvm' plugin.
- <ftp://sources.redhat.com/pub/lvm2/>
-
* libmemcached (optional)
Used by the `memcachec' plugin to connect to a memcache daemon.
<http://tangent.org/552/libmemcached.html>
#
AC_CHECK_FUNCS_ONCE([ \
asprintf \
+ execvpe \
getpwnam \
getpwnam_r \
if_indextoname \
- setenv \
setgroups \
setlocale
]
AM_CONDITIONAL([BUILD_WITH_LIBSOCKET], [test "x$socket_needs_socket" = "xyes"])
AM_CONDITIONAL([BUILD_WITH_GNULIB], [test "x$socket_needs_gnulib" = "xyes"])
+AC_CHECK_FUNCS([inet_ntop],
+ [],
+ [
+ AC_CHECK_LIB([nsl], [inet_ntop],
+ [inet_ntop_needs_nsl="yes"],
+ [AC_MSG_ERROR([cannot find inet_ntop() in libnsl])]
+ )
+ ]
+)
+AM_CONDITIONAL([BUILD_WITH_LIBNSL], [test "x$inet_ntop_needs_nsl" = "xyes"])
+
clock_gettime_needs_posix4="no"
AC_CHECK_FUNCS([clock_gettime],
[have_clock_gettime="yes"],
else
AC_MSG_RESULT([no])
with_libgrpcpp="no (requires C++11 support)"
+ with_libprotobuf="no (<google/protobuf/util/time_util.h> requires C++11 support)"
fi
fi
AC_SUBST(BUILD_WITH_LIBLUA_LIBS)
# }}}
-# --with-liblvm2app {{{
-AC_ARG_WITH([liblvm2app],
- [AS_HELP_STRING([--with-liblvm2app@<:@=PREFIX@:>@], [Path to liblvm2app.])],
- [
- if test "x$withval" = "xno"; then
- with_liblvm2app="no"
- else
- with_liblvm2app="yes"
- if test "x$withval" != "xyes"; then
- with_liblvm2app_cppflags="-I$withval/include"
- with_liblvm2app_ldflags="-L$withval/lib"
- fi
- fi
- ],
- [
- if test "x$ac_system" = "xLinux"; then
- with_liblvm2app="yes"
- else
- with_liblvm2app="no (Linux only library)"
- fi
- ]
-)
-
-if test "x$with_liblvm2app" = "xyes"; then
- SAVE_CPPFLAGS="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS $with_liblvm2app_cppflags"
-
- AC_CHECK_HEADERS([lvm2app.h],
- [with_liblvm2app="yes"],
- [with_liblvm2app="no (lvm2app.h not found)"]
- )
-
- CPPFLAGS="$SAVE_CPPFLAGS"
-fi
-
-if test "x$with_liblvm2app" = "xyes"; then
- SAVE_CPPFLAGS="$CPPFLAGS"
- SAVE_LDFLAGS="$LDFLAGS"
- CPPFLAGS="$CPPFLAGS $with_liblvm2app_cppflags"
- LDFLAGS="$LDFLAGS $with_liblvm2app_ldflags"
-
- AC_CHECK_LIB([lvm2app], [lvm_lv_get_property],
- [with_liblvm2app="yes"],
- [with_liblvm2app="no (Symbol 'lvm_lv_get_property' not found)"]
- )
-
- CPPFLAGS="$SAVE_CPPFLAGS"
- LDFLAGS="$SAVE_LDFLAGS"
-fi
-
-if test "x$with_liblvm2app" = "xyes"; then
- BUILD_WITH_LIBLVM2APP_CPPFLAGS="$with_liblvm2app_cppflags"
- BUILD_WITH_LIBLVM2APP_LDFLAGS="$with_liblvm2app_ldflags"
- BUILD_WITH_LIBLVM2APP_LIBS="-llvm2app"
-fi
-
-AC_SUBST([BUILD_WITH_LIBLVM2APP_CPPFLAGS])
-AC_SUBST([BUILD_WITH_LIBLVM2APP_LDFLAGS])
-AC_SUBST([BUILD_WITH_LIBLVM2APP_LIBS])
-# }}}
-
# --with-libmemcached {{{
AC_ARG_WITH([libmemcached],
[AS_HELP_STRING([--with-libmemcached@<:@=PREFIX@:>@], [Path to libmemcached.])],
AC_CHECK_LIB([protobuf], [main],
[
SAVE_CPPFLAGS="$CPPFLAGS"
- CPPFLAGS="$with_libprotobuf_cppflags $PROTOBUF_CFLAGS"
+ CPPFLAGS="-std=c++11 $with_libprotobuf_cppflags $PROTOBUF_CFLAGS"
if test "x$PROTOBUF_LIBS" = "x"
then
PROTOBUF_LIBS="-lprotobuf"
with_libtokyotyrant="$withval"
else
with_libtokyotyrant_cppflags="-I$withval/include"
- with_libtokyotyrant_ldflags="-L$withval/include"
+ with_libtokyotyrant_ldflags="-L$withval/lib"
with_libtokyotyrant_libs="-ltokyotyrant"
with_libtokyotyrant="yes"
fi
else if test "x$withval" = "xyes"; then
with_libupsclient="use_pkgconfig"
else
- if test -x "$withval"; then
+ if test -f "$withval" && test -x "$withval"; then
with_libupsclient_config="$withval"
with_libupsclient="use_libupsclient_config"
else if test -x "$withval/bin/libupsclient-config"; then
plugin_ipc="yes"
plugin_irq="yes"
plugin_load="yes"
- plugin_lvm="yes"
plugin_mcelog="yes"
plugin_memory="yes"
plugin_nfs="yes"
AC_PLUGIN([logfile], [yes], [File logging plugin])
AC_PLUGIN([lpar], [$with_perfstat], [AIX logical partitions statistics])
AC_PLUGIN([lua], [$with_liblua], [Lua plugin])
-AC_PLUGIN([lvm], [$with_liblvm2app], [LVM statistics])
AC_PLUGIN([madwifi], [$have_linux_wireless_h], [Madwifi wireless statistics])
AC_PLUGIN([match_empty_counter], [yes], [The empty counter match])
AC_PLUGIN([match_hashed], [yes], [The hashed match])
AC_MSG_RESULT([ libkvm . . . . . . . $with_libkvm])
AC_MSG_RESULT([ libldap . . . . . . . $with_libldap])
AC_MSG_RESULT([ liblua . . . . . . . $with_liblua])
-AC_MSG_RESULT([ liblvm2app . . . . . $with_liblvm2app])
AC_MSG_RESULT([ libmemcached . . . . $with_libmemcached])
AC_MSG_RESULT([ libmicrohttpd . . . . $with_libmicrohttpd])
AC_MSG_RESULT([ libmnl . . . . . . . $with_libmnl])
AC_MSG_RESULT([ log_logstash . . . . $enable_log_logstash])
AC_MSG_RESULT([ lpar . . . . . . . . $enable_lpar])
AC_MSG_RESULT([ lua . . . . . . . . . $enable_lua])
-AC_MSG_RESULT([ lvm . . . . . . . . . $enable_lvm])
AC_MSG_RESULT([ madwifi . . . . . . . $enable_madwifi])
AC_MSG_RESULT([ match_empty_counter . $enable_match_empty_counter])
AC_MSG_RESULT([ match_hashed . . . . $enable_match_hashed])
%define with_log_logstash 0%{!?_without_log_logstash:1}
%define with_logfile 0%{!?_without_logfile:1}
%define with_lua 0%{!?_without_lua:1}
-%define with_lvm 0%{!?_without_lvm:1}
%define with_madwifi 0%{!?_without_madwifi:1}
%define with_mbmon 0%{!?_without_mbmon:1}
%define with_mcelog 0%{!?_without_mcelog:1}
%define with_gmond 0
%define with_iptables 0
%define with_ipvs 0
-%define with_lvm 0
%define with_modbus 0
%define with_netlink 0
%define with_redis 0
Summary: Statistics collection and monitoring daemon
Name: collectd
-Version: 5.9.0
-Release: 1%{?dist}
+Version: 5.9.2
+Release: 2%{?dist}
URL: https://collectd.org
Source: https://collectd.org/files/%{name}-%{version}.tar.bz2
License: GPLv2
application programming interface (API) to Lua scripts.
%endif
-%if %{with_lvm}
-%package lvm
-Summary: LVM plugin for collectd
-Group: System Environment/Daemons
-Requires: %{name}%{?_isa} = %{version}-%{release}
-BuildRequires: lvm2-devel
-%description lvm
-This plugin collects size of “Logical Volumes” (LV) and “Volume Groups” (VG)
-of Linux' “Logical Volume Manager” (LVM).
-%endif
-
%if %{with_mcelog}
%package mcelog
Summary: Mcelog plugin for collectd
%define _with_lua --disable-lua
%endif
-%if %{with_lvm}
-%define _with_lvm --enable-lvm
-%else
-%define _with_lvm --disable-lvm
-%endif
-
%if %{with_madwifi}
%define _with_madwifi --enable-madwifi
%else
%{?_with_logfile} \
%{?_with_lpar} \
%{?_with_lua} \
- %{?_with_lvm} \
%{?_with_madwifi} \
%{?_with_mbmon} \
%{?_with_mcelog} \
%{_libdir}/%{name}/lua.so
%endif
-%if %{with_lvm}
-%files lvm
-%{_libdir}/%{name}/lvm.so
-%endif
-
%if %{with_memcachec}
%files memcachec
%{_libdir}/%{name}/memcachec.so
%doc contrib/
%changelog
+* Mon Oct 14 2019 Ruben Kerkhof <ruben@rubenkerkhof.com> - 5.9.2-2
+- Remove lvm plugin, liblvmapp has been deprecated upstream
+
* Fri Jun 14 2019 Fabien Wernli <rpmbuild@faxmodem.org> - 5.9.0-1
- add code for write_stackdriver (disabled for now)
- add code for gpu_nvidia (disabled for now)
The number of times that a query should be retried after the Timeout expires.
The C<Net-SNMP> library default is 5.
+=item B<BulkSize> I<Integer>
+
+Configures the size of SNMP bulk transfers. The default is 0, which disables bulk transfers altogether.
+
=back
=head1 SEE ALSO
@BUILD_PLUGIN_LOAD_TRUE@@BUILD_PLUGIN_LOAD_TRUE@LoadPlugin load
#@BUILD_PLUGIN_LPAR_TRUE@LoadPlugin lpar
#@BUILD_PLUGIN_LUA_TRUE@LoadPlugin lua
-#@BUILD_PLUGIN_LVM_TRUE@LoadPlugin lvm
#@BUILD_PLUGIN_MADWIFI_TRUE@LoadPlugin madwifi
#@BUILD_PLUGIN_MBMON_TRUE@LoadPlugin mbmon
#@BUILD_PLUGIN_MCELOG_TRUE@LoadPlugin mcelog
# Version 2
# Community "another_string"
# Collect "std_traffic" "hr_users"
+# BulkSize 0
# </Host>
# <Host "some.ups.mydomain.org">
# Address "192.168.0.3"
# Timeout 5
# Retries 5
# </Host>
+# <Host "highend.switch.example.org">
+# Address "192.168.0.3"
+# Version 2
+# Community "another_string"
+# Collect "std_traffic"
+# Interval 10
+# Timeout 10
+# BulkSize 100
+# </Host>
#</Plugin>
#<Plugin snmp_agent>
Username to use when connecting to the database. The user does not have to be
granted any privileges (which is synonym to granting the C<USAGE> privilege),
-unless you want to collectd replication statistics (see B<MasterStats> and
+unless you want to collect replication statistics (see B<MasterStats> and
B<SlaveStats> below). In this case, the user needs the C<REPLICATION CLIENT>
(or C<SUPER>) privileges. Else, any existing MySQL user will do.
=item B<WsrepStats> I<true|false>
- Enable the collection of wsrep plugin statistics, used in Master-Master
- replication setups like in MySQL Galera/Percona XtraDB Cluster.
- User needs only privileges to execute 'SHOW GLOBAL STATUS'
+Enable the collection of wsrep plugin statistics, used in Master-Master
+replication setups like in MySQL Galera/Percona XtraDB Cluster.
+User needs only privileges to execute 'SHOW GLOBAL STATUS'.
+Defaults to B<false>.
=item B<ConnectTimeout> I<Seconds>
extern char *optarg;
extern int optind;
-/* ssnprintf returns zero on success, one if truncation occurred
- and a negative integer onerror. */
+/* _ssnprintf returns result from vsnprintf (consistent with snprintf) */
static int _ssnprintf(char *str, size_t sz, const char *format, ...) {
va_list ap;
va_start(ap, format);
va_end(ap);
- if (ret < 0) {
- return ret;
- }
- return (size_t)ret >= sz;
+ return ret;
} /* int _ssnprintf */
__attribute__((noreturn)) static void exit_usage(const char *name, int status) {
#include "plugin.h"
#include "utils/common/common.h"
-#ifdef HAVE_SYS_SYSCTL_H
+#if defined(HAVE_SYSCTLBYNAME) && defined(HAVE_SYS_SYSCTL_H)
#include <sys/sysctl.h>
-#endif
-
-#if HAVE_SYSCTLBYNAME
/* no global variables */
/* #endif HAVE_SYSCTLBYNAME */
#define _DEFAULT_SOURCE
#define _BSD_SOURCE /* For setgroups */
+/* _GNU_SOURCE is needed in Linux to use execvpe */
+#define _GNU_SOURCE
+
#include "collectd.h"
#include "plugin.h"
#include <sys/capability.h>
#endif
+extern char **environ;
+
#define PL_NORMAL 0x01
#define PL_NOTIF_ACTION 0x02
return 0;
} /* int exec_config }}} */
-#if !defined(HAVE_SETENV)
-static char env_interval[64];
-// max hostname len is 255, so this should be enough
-static char env_hostname[300];
-#endif
-
-static void set_environment(void) /* {{{ */
-{
-#ifdef HAVE_SETENV
- char buffer[1024];
-
- snprintf(buffer, sizeof(buffer), "%.3f",
- CDTIME_T_TO_DOUBLE(plugin_get_interval()));
- setenv("COLLECTD_INTERVAL", buffer, /* overwrite = */ 1);
-
- sstrncpy(buffer, hostname_g, sizeof(buffer));
- setenv("COLLECTD_HOSTNAME", buffer, /* overwrite = */ 1);
-#else
- snprintf(env_interval, sizeof(env_interval), "COLLECTD_INTERVAL=%.3f",
- CDTIME_T_TO_DOUBLE(plugin_get_interval()));
- putenv(env_interval);
-
- snprintf(env_hostname, sizeof(env_hostname), "COLLECTD_HOSTNAME=%s",
- hostname_g);
- putenv(env_hostname);
-#endif
-} /* }}} void set_environment */
-
-static void unset_environment(void) /* {{{ */
-{
-#ifdef HAVE_SETENV
- unsetenv("COLLECTD_INTERVAL");
- unsetenv("COLLECTD_HOSTNAME");
-#else
- snprintf(env_interval, sizeof(env_interval), "COLLECTD_INTERVAL");
- putenv(env_interval);
- snprintf(env_hostname, sizeof(env_hostname), "COLLECTD_HOSTNAME");
- putenv(env_hostname);
-#endif
-} /* }}} void unset_environment */
-
-__attribute__((noreturn)) static void exec_child(program_list_t *pl, int uid,
- int gid, int egid) /* {{{ */
+__attribute__((noreturn)) static void exec_child(program_list_t *pl,
+ char **envp, int uid, int gid,
+ int egid) /* {{{ */
{
int status;
exit(-1);
}
+#ifdef HAVE_EXECVPE
+ execvpe(pl->exec, pl->argv, envp);
+#else
+ environ = envp;
execvp(pl->exec, pl->argv);
+#endif
ERROR("exec plugin: Failed to execute ``%s'': %s", pl->exec, STRERRNO);
exit(-1);
goto failed;
}
- set_environment();
+ double interval = CDTIME_T_TO_DOUBLE(plugin_get_interval());
pid = fork();
if (pid < 0) {
ERROR("exec plugin: fork failed: %s", STRERRNO);
goto failed;
} else if (pid == 0) {
- int fd_num;
+ char interval_buf[128];
+ snprintf(interval_buf, sizeof(interval_buf), "COLLECTD_INTERVAL=%.3f",
+ interval);
+
+ /* max hostname len is 255, so this should be enough */
+ char hostname_buf[300];
+ snprintf(hostname_buf, sizeof(hostname_buf), "COLLECTD_HOSTNAME=%s",
+ hostname_g);
+
+ size_t env_size = 0;
+ while (environ[env_size] != NULL) {
+ ++env_size;
+ }
+
+ /* Copy the environment variables */
+ char *envp[env_size + 3];
+ size_t envp_idx;
+ for (envp_idx = 0; environ[envp_idx] != NULL && envp_idx < env_size;
+ ++envp_idx) {
+ envp[envp_idx] = environ[envp_idx];
+ }
+
+ /* Add the collectd environment variables */
+ envp[envp_idx++] = interval_buf;
+ envp[envp_idx++] = hostname_buf;
+ envp[envp_idx++] = NULL;
/* Close all file descriptors but the pipe end we need. */
- fd_num = getdtablesize();
+ int fd_num = getdtablesize();
for (int fd = 0; fd < fd_num; fd++) {
if ((fd == fd_pipe_in[0]) || (fd == fd_pipe_out[1]) ||
(fd == fd_pipe_err[1]))
/* Unblock all signals */
reset_signal_mask();
- exec_child(pl, uid, gid, egid);
+ exec_child(pl, envp, uid, gid, egid);
/* does not return */
}
- unset_environment();
-
close(fd_pipe_in[0]);
close(fd_pipe_out[1]);
close(fd_pipe_err[1]);
return pid;
failed:
- unset_environment();
-
close_pipe(fd_pipe_in);
close_pipe(fd_pipe_out);
close_pipe(fd_pipe_err);
INFO("exec plugin: Sent SIGTERM to %hu", (unsigned short int)pl->pid);
}
+ for (int i = 0; pl->argv[i] != NULL; i++) {
+ sfree(pl->argv[i]);
+ }
+ sfree(pl->argv);
+ sfree(pl->exec);
sfree(pl->user);
sfree(pl);
class->object = NULL;
if (class->object == NULL) {
ERROR("java plugin: cjni_config_load_plugin: "
- "Could create a new `%s' object.",
+ "Could not create a new `%s' object.",
class->name);
cjni_thread_detach();
free(class->name);
+++ /dev/null
-/**
- * collectd - src/lvm.c
- * Copyright (C) 2013 Chad Malfait
- * Copyright (C) 2014 Carnegie Mellon University
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; only version 2 of the License is applicable.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Authors:
- * Chad Malfait <malfaitc at yahoo.com>
- * Benjamin Gilbert <bgilbert at backtick.net>
- **/
-
-#include "collectd.h"
-
-#include "plugin.h"
-#include "utils/common/common.h"
-
-#include <lvm2app.h>
-
-#ifdef HAVE_SYS_CAPABILITY_H
-#include <sys/capability.h>
-#endif /* HAVE_SYS_CAPABILITY_H */
-
-#define NO_VALUE UINT64_MAX
-#define PERCENT_SCALE_FACTOR 1e-8
-
-static uint64_t get_lv_property_int(lv_t lv, char const *property) {
- lvm_property_value_t v;
-
- v = lvm_lv_get_property(lv, property);
- if (!v.is_valid || !v.is_integer)
- return NO_VALUE;
- /* May be NO_VALUE if @property does not apply to this LV */
- return v.value.integer;
-}
-
-static char const *get_lv_property_string(lv_t lv, char const *property) {
- lvm_property_value_t v;
-
- v = lvm_lv_get_property(lv, property);
- if (!v.is_valid || !v.is_string)
- return NULL;
- return v.value.string;
-}
-
-static void lvm_submit(char const *plugin_instance, char const *type_instance,
- uint64_t ivalue) {
- value_list_t vl = VALUE_LIST_INIT;
-
- vl.values = &(value_t){.gauge = (gauge_t)ivalue};
- vl.values_len = 1;
-
- sstrncpy(vl.plugin, "lvm", sizeof(vl.plugin));
- sstrncpy(vl.plugin_instance, plugin_instance, sizeof(vl.plugin_instance));
- sstrncpy(vl.type, "df_complex", sizeof(vl.type));
- sstrncpy(vl.type_instance, type_instance, sizeof(vl.type_instance));
-
- plugin_dispatch_values(&vl);
-}
-
-static void report_lv_utilization(lv_t lv, char const *vg_name,
- char const *lv_name, uint64_t lv_size,
- char const *used_percent_property) {
- uint64_t used_percent_unscaled;
- uint64_t used_bytes;
- char plugin_instance[DATA_MAX_NAME_LEN];
-
- used_percent_unscaled = get_lv_property_int(lv, used_percent_property);
- if (used_percent_unscaled == NO_VALUE)
- return;
- used_bytes = lv_size * (used_percent_unscaled * PERCENT_SCALE_FACTOR);
-
- ssnprintf(plugin_instance, sizeof(plugin_instance), "%s-%s", vg_name,
- lv_name);
- lvm_submit(plugin_instance, "used", used_bytes);
- lvm_submit(plugin_instance, "free", lv_size - used_bytes);
-}
-
-static void report_thin_pool_utilization(lv_t lv, char const *vg_name,
- uint64_t lv_size) {
- char const *data_lv;
- char const *metadata_lv;
- uint64_t metadata_size;
-
- data_lv = get_lv_property_string(lv, "data_lv");
- metadata_lv = get_lv_property_string(lv, "metadata_lv");
- metadata_size = get_lv_property_int(lv, "lv_metadata_size");
- if (data_lv == NULL || metadata_lv == NULL || metadata_size == NO_VALUE)
- return;
-
- report_lv_utilization(lv, vg_name, data_lv, lv_size, "data_percent");
- report_lv_utilization(lv, vg_name, metadata_lv, metadata_size,
- "metadata_percent");
-}
-
-static void vg_read(vg_t vg, char const *vg_name) {
- struct dm_list *lvs;
- struct lvm_lv_list *lvl;
- char const *name;
- char const *attrs;
- uint64_t size;
-
- lvm_submit(vg_name, "free", lvm_vg_get_free_size(vg));
-
- lvs = lvm_vg_list_lvs(vg);
- if (!lvs) {
- /* no VGs are defined, which is not an error per se */
- return;
- }
-
- dm_list_iterate_items(lvl, lvs) {
- name = lvm_lv_get_name(lvl->lv);
- attrs = get_lv_property_string(lvl->lv, "lv_attr");
- size = lvm_lv_get_size(lvl->lv);
- if (name == NULL || attrs == NULL || size == NO_VALUE)
- continue;
-
- /* Condition on volume type. We want the reported sizes in the
- volume group to sum to the size of the volume group, so we ignore
- virtual volumes. */
- switch (attrs[0]) {
- case 's':
- case 'S':
- /* Snapshot. Also report used/free space. */
- report_lv_utilization(lvl->lv, vg_name, name, size, "data_percent");
- break;
- case 't':
- /* Thin pool virtual volume. We report the underlying data
- and metadata volumes, not this one. Report used/free
- space, then ignore. */
- report_thin_pool_utilization(lvl->lv, vg_name, size);
- continue;
- case 'v':
- /* Virtual volume. Ignore. */
- continue;
- case 'V':
- /* Thin volume or thin snapshot. Ignore. */
- continue;
- }
- lvm_submit(vg_name, name, size);
- }
-}
-
-static int lvm_read(void) {
- lvm_t lvm;
- struct dm_list *vg_names;
- struct lvm_str_list *name_list;
-
- lvm = lvm_init(NULL);
- if (!lvm) {
- ERROR("lvm plugin: lvm_init failed.");
- return -1;
- }
-
- vg_names = lvm_list_vg_names(lvm);
- if (!vg_names) {
- ERROR("lvm plugin lvm_list_vg_name failed %s", lvm_errmsg(lvm));
- lvm_quit(lvm);
- return -1;
- }
-
- dm_list_iterate_items(name_list, vg_names) {
- vg_t vg;
-
- vg = lvm_vg_open(lvm, name_list->str, "r", 0);
- if (!vg) {
- ERROR("lvm plugin: lvm_vg_open (%s) failed: %s", name_list->str,
- lvm_errmsg(lvm));
- continue;
- }
-
- vg_read(vg, name_list->str);
- lvm_vg_close(vg);
- }
-
- lvm_quit(lvm);
- return 0;
-} /*lvm_read */
-
-static int c_lvm_init(void) {
-#if defined(HAVE_SYS_CAPABILITY_H) && defined(CAP_SYS_ADMIN)
- if (check_capability(CAP_SYS_ADMIN) != 0) {
- if (getuid() == 0)
- WARNING("lvm plugin: Running collectd as root, but the "
- "CAP_SYS_ADMIN capability is missing. The plugin's read "
- "function will probably fail. Is your init system dropping "
- "capabilities?");
- else
- WARNING("lvm plugin: collectd doesn't have the CAP_SYS_ADMIN "
- "capability. If you don't want to run collectd as root, try "
- "running \"setcap cap_sys_admin=ep\" on the collectd binary.");
- }
-#endif
- return 0;
-}
-
-void module_register(void) {
- plugin_register_init("lvm", c_lvm_init);
- plugin_register_read("lvm", lvm_read);
-} /* void module_register */
} data;
struct sockent *next;
+ pthread_mutex_t lock;
} sockent_t;
/* 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
sfree(se->node);
sfree(se->service);
+ pthread_mutex_destroy(&se->lock);
if (se->type == SOCKENT_TYPE_CLIENT)
free_sockent_client(&se->data.client);
se->service = NULL;
se->interface = 0;
se->next = NULL;
+ pthread_mutex_init(&se->lock, NULL);
if (type == SOCKENT_TYPE_SERVER) {
se->data.server.fd = NULL;
client->fd = -1;
}
+ DEBUG("network plugin: free (se = %p, addr = %p);", (void *)se,
+ (void *)client->addr);
sfree(client->addr);
client->addrlen = 0;
client->fd = -1;
continue;
}
+ DEBUG("network plugin: alloc (se = %p, addr = %p);", (void *)se,
+ (void *)client->addr);
assert(sizeof(*client->addr) >= ai_ptr->ai_addrlen);
memcpy(client->addr, ai_ptr->ai_addr, ai_ptr->ai_addrlen);
buffer_len);
for (sockent_t *se = sending_sockets; se != NULL; se = se->next) {
+ pthread_mutex_lock(&se->lock);
#if HAVE_GCRYPT_H
if (se->data.client.security_level == SECURITY_LEVEL_ENCRYPT)
network_send_buffer_encrypted(se, buffer, buffer_len);
else /* if (se->data.client.security_level == SECURITY_LEVEL_NONE) */
#endif /* HAVE_GCRYPT_H */
network_send_buffer_plain(se, buffer, buffer_len);
+ pthread_mutex_unlock(&se->lock);
} /* for (sending_sockets) */
} /* }}} void network_send_buffer */
c_complain_t complaint;
data_definition_t **data_list;
int data_list_len;
+ int bulk_size;
};
typedef struct host_definition_s host_definition_t;
/* These mean that we have not set a timeout or retry value */
hd->timeout = 0;
hd->retries = -1;
+ hd->bulk_size = 0;
for (int i = 0; i < ci->children_num; i++) {
oconfig_item_t *option = ci->children + i;
status = csnmp_config_add_host_security_level(hd, option);
else if (strcasecmp("Context", option->key) == 0)
status = cf_util_get_string(option, &hd->context);
+ else if (strcasecmp("BulkSize", option->key) == 0)
+ status = cf_util_get_int(option, &hd->bulk_size);
else {
WARNING(
"snmp plugin: csnmp_config_add_host: Option `%s' not allowed here.",
status = -1;
break;
}
+ if (hd->bulk_size > 0 && hd->version < 2) {
+ WARNING("snmp plugin: Bulk transfers is only available for SNMP v2 and "
+ "later, host '%s' is configured as version '%d'",
+ hd->name, hd->version);
+ }
if (hd->version == 3) {
if (hd->username == NULL) {
WARNING("snmp plugin: `Username' not given for host `%s'", hd->name);
status = 0;
while (status == 0) {
- req = snmp_pdu_create(SNMP_MSG_GETNEXT);
+ /* If SNMP v2 and later and bulk transfers enabled, use GETBULK PDU */
+ if (host->version > 1 && host->bulk_size > 0) {
+ req = snmp_pdu_create(SNMP_MSG_GETBULK);
+ req->non_repeaters = 0;
+ req->max_repetitions = host->bulk_size;
+ } else {
+ req = snmp_pdu_create(SNMP_MSG_GETNEXT);
+ }
if (req == NULL) {
ERROR("snmp plugin: snmp_pdu_create failed.");
status = -1;
break;
}
+ if (req->command == SNMP_MSG_GETBULK) {
+ /* In bulk mode the host will send 'max_repetitions' values per
+ requested variable, so we need to split it per number of variable
+ to stay 'in budget' */
+ req->max_repetitions = floor(host->bulk_size / oid_list_todo_num);
+ }
+
res = NULL;
status = snmp_sess_synch_response(host->sess_handle, req, &res);
continue;
}
- for (vb = res->variables, i = 0; (vb != NULL);
- vb = vb->next_variable, i++) {
+ size_t j;
+ for (vb = res->variables, j = 0; (vb != NULL);
+ vb = vb->next_variable, j++) {
+ i = j;
+ /* If bulk request is active convert value index of the extra value */
+ if (host->version > 1 && host->bulk_size > 0) {
+ i %= oid_list_todo_num;
+ }
/* Calculate value index from todo list */
while ((i < oid_list_len) && !oid_list_todo[i]) {
i++;
+ j++;
}
if (i >= oid_list_len) {
break;
parse_int_file(const char *fmt, ...) {
va_list args;
char path[PATH_MAX];
+ char buf[256];
int len;
+ value_t v;
+ char *c;
+ FILE *fp;
va_start(args, fmt);
len = vsnprintf(path, sizeof(path), fmt, args);
return -1;
}
- value_t v;
- if (parse_value_file(path, &v, DS_TYPE_DERIVE) != 0) {
+ fp = fopen(path, "r");
+ if (fp == NULL) {
+ ERROR("turbostat plugin: unable to open: '%s': %s", path, strerror(errno));
+ return -1;
+ }
+
+ if (fgets(buf, sizeof(buf), fp) == NULL) {
+ ERROR("turbostat plugin: unable to read: '%s': %s", path, strerror(errno));
+ fclose(fp);
+ return -1;
+ }
+ fclose(fp);
+
+ /* We only care about the first integer in the range */
+ c = strchr(buf, '-');
+ if (c != NULL)
+ *c = '\0';
+ c = strchr(buf, ',');
+ if (c != NULL)
+ *c = '\0';
+ strstripnewline(buf);
+
+ if (parse_value(buf, &v, DS_TYPE_DERIVE) != 0) {
ERROR("turbostat plugin: Parsing \"%s\" failed.", path);
return -1;
}
return dest;
} /* char *sstrncpy */
-/* ssnprintf returns zero on success, one if truncation occurred
- and a negative integer onerror. */
+/* ssnprintf returns result from vsnprintf conistent with snprintf */
int ssnprintf(char *str, size_t sz, const char *format, ...) {
va_list ap;
va_start(ap, format);
va_end(ap);
- if (ret < 0) {
- return ret;
- }
- return (size_t)ret >= sz;
+ return ret;
} /* int ssnprintf */
char *ssnprintf_alloc(char const *format, ...) /* {{{ */
};
for (size_t i = 0; i < STATIC_ARRAY_SIZE(cases); i++) {
- char buffer[32];
+ char buffer[32] = {0};
- strncpy(buffer, cases[i].str, sizeof(buffer));
+ strncpy(buffer, cases[i].str, sizeof(buffer) - 1);
OK(escape_slashes(buffer, sizeof(buffer)) == 0);
EXPECT_EQ_STR(cases[i].want, buffer);
}
};
for (size_t i = 0; i < STATIC_ARRAY_SIZE(cases); i++) {
- char buffer[16];
+ char buffer[16] = {0};
- strncpy(buffer, cases[i].str, sizeof(buffer));
+ strncpy(buffer, cases[i].str, sizeof(buffer) - 1);
OK(escape_string(buffer, sizeof(buffer)) == 0);
EXPECT_EQ_STR(cases[i].want, buffer);
}
}
DEF_TEST(strunescape) {
- char buffer[16];
+ char buffer[32] = {0};
int status;
- strncpy(buffer, "foo\\tbar", sizeof(buffer));
+ strncpy(buffer, "foo\\tbar", sizeof(buffer) - 1);
status = strunescape(buffer, sizeof(buffer));
OK(status == 0);
EXPECT_EQ_STR("foo\tbar", buffer);
- strncpy(buffer, "\\tfoo\\r\\n", sizeof(buffer));
+ strncpy(buffer, "\\tfoo\\r\\n", sizeof(buffer) - 1);
status = strunescape(buffer, sizeof(buffer));
OK(status == 0);
EXPECT_EQ_STR("\tfoo\r\n", buffer);
- strncpy(buffer, "With \\\"quotes\\\"", sizeof(buffer));
+ strncpy(buffer, "With \\\"quotes\\\"", sizeof(buffer) - 1);
status = strunescape(buffer, sizeof(buffer));
OK(status == 0);
EXPECT_EQ_STR("With \"quotes\"", buffer);
/* Backslash before null byte */
- strncpy(buffer, "\\tbackslash end\\", sizeof(buffer));
+ strncpy(buffer, "\\tbackslash end\\", sizeof(buffer) - 1);
status = strunescape(buffer, sizeof(buffer));
OK(status != 0);
EXPECT_EQ_STR("\tbackslash end", buffer);
return 0;
/* Backslash at buffer end */
- strncpy(buffer, "\\t3\\56", sizeof(buffer));
+ strncpy(buffer, "\\t3\\56", sizeof(buffer) - 1);
status = strunescape(buffer, 4);
OK(status != 0);
OK(buffer[0] == '\t');
za_read_gauge(ksp, "mfu_size", "cache_size", "mfu_size");
za_read_gauge(ksp, "mru_ghost_size", "cache_size", "mru_ghost_size");
za_read_gauge(ksp, "mru_size", "cache_size", "mru_size");
- za_read_gauge(ksp, "other_size", "cache_size", "other_size");
za_read_gauge(ksp, "p", "cache_size", "p");
za_read_gauge(ksp, "size", "cache_size", "arc");
+ /* The "other_size" value was replaced by more specific values in ZFS on Linux
+ * version 0.7.0 (commit 25458cb)
+ */
+ if (za_read_gauge(ksp, "dbuf_size", "cache_size", "dbuf_size") != 0 ||
+ za_read_gauge(ksp, "dnode_size", "cache_size", "dnode_size") != 0 ||
+ za_read_gauge(ksp, "bonus_size", "cache_size", "bonus_size") != 0)
+ za_read_gauge(ksp, "other_size", "cache_size", "other_size");
+
/* The "l2_size" value has disappeared from Solaris some time in
* early 2013, and has only reappeared recently in Solaris 11.2.
* Stop trying if we ever fail to read it, so we don't spam the log.
#!/bin/sh
-DEFAULT_VERSION="5.8.1.git"
+DEFAULT_VERSION="5.9.2.git"
if [ -d .git ]; then
VERSION="`git describe --dirty=+ --abbrev=7 2> /dev/null | grep collectd | sed -e 's/^collectd-//' -e 's/-/./g'`"