Giter VIP home page Giter VIP logo

collectd / collectd Goto Github PK

View Code? Open in Web Editor NEW
3.0K 3.0K 1.2K 28.33 MB

The system statistics collection daemon. Please send Pull Requests here!

Home Page: http://collectd.org

License: Other

Java 1.49% Perl 9.47% Shell 0.37% Python 0.70% Ruby 0.06% JavaScript 0.54% CSS 0.02% C 79.75% PHP 2.01% Yacc 0.09% Lex 0.08% Makefile 1.15% M4 3.57% PLpgSQL 0.32% C++ 0.37% Dockerfile 0.01%
amqp-client c collectd cpu-monitoring graphite-client influxdb-client kafka-client memory-utilization metrics metrics-gathering metrics-gathering-daemon metrics-server mqtt-client mqtt-server prometheus-exporter redis-client riemann-client rrdtool snmp stackdriver-agent

collectd's Introduction

collectd - System information collection daemon

https://collectd.org/

About

collectd is a small daemon which collects system information periodically and provides mechanisms to store and monitor the values in a variety of ways.

Features

  • collectd is able to collect the following data:

    • apache Apache server utilization: Number of bytes transferred, number of requests handled and detailed scoreboard statistics

    • apcups APC UPS Daemon: UPS charge, load, input/output/battery voltage, etc.

    • apple_sensors Sensors in Macs running Mac OS X / Darwin: Temperature, fan speed and voltage sensors.

    • aquaero Various sensors in the Aquaero 5 water cooling board made by Aquacomputer.

    • ascent Statistics about Ascent, a free server for the game `World of Warcraft'.

    • barometer Reads absolute barometric pressure, air pressure reduced to sea level and temperature. Supported sensors are MPL115A2 and MPL3115 from Freescale and BMP085 from Bosch.

    • battery Batterycharge, -current and voltage of ACPI and PMU based laptop batteries.

    • bind Name server and resolver statistics from the `statistics-channel' interface of BIND 9.5, 9,6 and later.

    • buddyinfo Statistics from buddyinfo file about memory fragmentation.

    • capabilities Platform capabilities decoded from hardware subsystems, for example from SMBIOS using dmidecode. https://www.nongnu.org/dmidecode/

    • ceph Statistics from the Ceph distributed storage system.

    • cgroups CPU accounting information for process groups under Linux.

    • chrony Chrony daemon statistics: Local clock drift, offset to peers, etc.

    • connectivity Event-based interface status.

    • conntrack Number of nf_conntrack entries.

    • contextswitch Number of context switches done by the operating system.

    • cpu CPU utilization: Time spent in the system, user, nice, idle, and related states.

    • cpufreq CPU frequency (For laptops with speed step or a similar technology)

    • cpusleep CPU sleep: Time spent in suspend (For mobile devices which enter suspend automatically)

    • curl Parse statistics from websites using regular expressions.

    • curl_json Retrieves JSON data via cURL and parses it according to user configuration.

    • curl_xml Retrieves XML data via cURL and parses it according to user configuration.

    • dbi Executes SQL statements on various databases and interprets the returned data.

    • dcpmm Collects Intel Optane DC Presistent Memory (DCPMM) performance and health statistics.

    • df Mountpoint usage (Basically the values `df(1)' delivers)

    • disk Disk utilization: Sectors read/written, number of read/write actions, average time an IO-operation took to complete.

    • dns DNS traffic: Query types, response codes, opcodes and traffic/octets transferred.

    • dpdkstat Collect DPDK interface statistics. See docs/BUILD.dpdkstat.md for detailed build instructions.

      This plugin should be compiled with compiler defenses enabled, for example -fstack-protector.

    • dpdk_telemetry Collect DPDK interface, application and global statistics. This plugin can be used as a substitute to dpdkstat plugin.

      This plugin is dependent on DPDK 19.08 release and must be used along with the DPDK application.

      Also, this plugin has dependency on Jansson library.

    • drbd Collect individual drbd resource statistics.

    • email Email statistics: Count, traffic, spam scores and checks. See collectd-email(5).

    • entropy Amount of entropy available to the system.

    • epics Collect data from EPICS message bus. https://epics-controls.org

    • ethstat Network interface card statistics.

    • exec Values gathered by a custom program or script. See collectd-exec(5).

    • fhcount File handles statistics.

    • filecount Count the number of files in directories.

    • fscache Linux file-system based caching framework statistics.

    • gmond Receive multicast traffic from Ganglia instances.

    • gps Monitor gps related data through gpsd.

    • gpu_nvidia Monitor NVIDIA GPU statistics available through NVML.

    • hddtemp Hard disk temperatures using hddtempd.

    • hugepages Report the number of used and free hugepages. More info on hugepages can be found here: https://www.kernel.org/doc/Documentation/vm/hugetlbpage.txt.

      This plugin should be compiled with compiler defenses enabled, for example -fstack-protector.

    • infiniband Attributes and counters for each port on each IB device.

    • intel_pmu The intel_pmu plugin reads performance counters provided by the Linux kernel perf interface. The plugin uses jevents library to resolve named events to perf events and access perf interface.

    • intel_rdt The intel_rdt plugin collects information provided by monitoring features of Intel Resource Director Technology (Intel(R) RDT) like Cache Monitoring Technology (CMT), Memory Bandwidth Monitoring (MBM). These features provide information about utilization of shared resources like last level cache occupancy, local memory bandwidth usage, remote memory bandwidth usage, instructions per clock. https://01.org/packet-processing/cache-monitoring-technology-memory-bandwidth-monitoring-cache-allocation-technology-code-and-data

    • interface Interface traffic: Number of octets, packets and errors for each interface.

    • ipc IPC counters: semaphores used, number of allocated segments in shared memory and more.

    • ipmi IPMI (Intelligent Platform Management Interface) sensors information.

    • ipstats IPv4 and IPv6; incoming, outgoing, forwarded counters. FreeBSD only.

    • iptables Iptables' counters: Number of bytes that were matched by a certain iptables rule.

    • ipvs IPVS connection statistics (number of connections, octets and packets for each service and destination). See http://www.linuxvirtualserver.org/software/index.html.

    • irq IRQ counters: Frequency in which certain interrupts occur.

    • java Integrates a `Java Virtual Machine' (JVM) to execute plugins in Java bytecode. See docs/BUILD.java.md for detailed build instructions.

    • load System load average over the last 1, 5 and 15 minutes.

    • lpar Detailed CPU statistics of the “Logical Partitions” virtualization technique built into IBM's POWER processors.

    • lua The Lua plugin implements a Lua interpreter into collectd. This makes it possible to write plugins in Lua which are executed by collectd without the need to start a heavy interpreter every interval. See collectd-lua(5) for details.

    • madwifi Queries very detailed usage statistics from wireless LAN adapters and interfaces that use the Atheros chipset and the MadWifi driver.

    • mbmon Motherboard sensors: temperature, fan speed and voltage information, using mbmon(1).

    • mcelog Monitor machine check exceptions (hardware errors detected by hardware and reported to software) reported by mcelog and generate appropriate notifications when machine check exceptions are detected.

    • md Linux software-RAID device information (number of active, failed, spare and missing disks).

    • memcachec Query and parse data from a memcache daemon (memcached).

    • memcached Statistics of the memcached distributed caching system. http://www.danga.com/memcached/

    • memory Memory utilization: Memory occupied by running processes, page cache, buffer cache and free.

    • mic Collects CPU usage, memory usage, temperatures and power consumption from Intel Many Integrated Core (MIC) CPUs.

    • mmc Reads the life time estimates reported by eMMC 5.0+ devices and some more detailed health metrics, like bad block and erase counts or power cycles, for micron and sandisk eMMCs and some swissbit mmc Cards (MANFID=0x5D OEMID=0x5342).

    • modbus Reads values from Modbus/TCP enabled devices. Supports reading values from multiple "slaves" so gateway devices can be used.

    • multimeter Information provided by serial multimeters, such as the `Metex M-4650CR'.

    • mysql MySQL server statistics: Commands issued, handlers triggered, thread usage, query cache utilization and traffic/octets sent and received.

    • netapp Plugin to query performance values from a NetApp storage system using the “Manage ONTAP” SDK provided by NetApp.

    • netlink Very detailed Linux network interface and routing statistics. You can get (detailed) information on interfaces, qdiscs, classes, and, if you can make use of it, filters.

    • network Receive values that were collected by other hosts. Large setups will want to collect the data on one dedicated machine, and this is the plugin of choice for that.

    • nfs NFS Procedures: Which NFS command were called how often.

    • nginx Collects statistics from `nginx' (speak: engine X), a HTTP and mail server/proxy.

    • ntpd NTP daemon statistics: Local clock drift, offset to peers, etc.

    • numa Information about Non-Uniform Memory Access (NUMA).

    • nut Network UPS tools: UPS current, voltage, power, charge, utilisation, temperature, etc. See upsd(8).

    • olsrd Queries routing information from the “Optimized Link State Routing” daemon.

    • onewire (EXPERIMENTAL!) Read onewire sensors using the owcapu library of the owfs project. Please read in collectd.conf(5) why this plugin is experimental.

    • openldap Read monitoring information from OpenLDAP's cn=Monitor subtree.

    • openvpn RX and TX of each client in openvpn-status.log (status-version 2). http://openvpn.net/index.php/documentation/howto.html

    • oracle Query data from an Oracle database.

    • ovs_events The plugin monitors the link status of Open vSwitch (OVS) connected interfaces, dispatches the values to collectd and sends the notification whenever the link state change occurs in the OVS database. It requires YAJL library to be installed. Detailed instructions for installing and setting up Open vSwitch, see OVS documentation. http://openvswitch.org/support/dist-docs/INSTALL.rst.html

    • ovs_stats The plugin collects the statistics of OVS connected bridges and interfaces. It requires YAJL library to be installed. Detailed instructions for installing and setting up Open vSwitch, see OVS documentation. http://openvswitch.org/support/dist-docs/INSTALL.rst.html

    • pcie_errors Read errors from PCI Express Device Status and AER extended capabilities. https://www.design-reuse.com/articles/38374/pcie-error-logging-and-handling-on-a-typical-soc.html

    • perl The perl plugin implements a Perl-interpreter into collectd. You can write your own plugins in Perl and return arbitrary values using this API. See collectd-perl(5).

    • pf Query statistics from BSD's packet filter "pf".

    • pinba Receive and dispatch timing values from Pinba, a profiling extension for PHP.

    • ping Network latency: Time to reach the default gateway or another given host.

    • postgresql PostgreSQL database statistics: active server connections, transaction numbers, block IO, table row manipulations.

    • powerdns PowerDNS name server statistics.

    • processes Process counts: Number of running, sleeping, zombie, ... processes.

    • procevent Listens for process starts and exits via netlink.

    • protocols Counts various aspects of network protocols such as IP, TCP, UDP, etc.

    • python The python plugin implements a Python interpreter into collectd. This makes it possible to write plugins in Python which are executed by collectd without the need to start a heavy interpreter every interval. See collectd-python(5) for details.

    • ras The ras plugin gathers and counts errors provided by RASDaemon

    • redis The redis plugin gathers information from a Redis server, including: uptime, used memory, total connections etc.

    • routeros Query interface and wireless registration statistics from RouterOS.

    • rrdcached RRDtool caching daemon (RRDcacheD) statistics.

    • sensors System sensors, accessed using lm_sensors: Voltages, temperatures and fan rotation speeds.

    • serial RX and TX of serial interfaces. Linux only; needs root privileges.

    • sigrok Uses libsigrok as a backend, allowing any sigrok-supported device to have its measurements fed to collectd. This includes multimeters, sound level meters, thermometers, and much more.

    • slurm Gathers per-partition node and job state information using libslurm, as well as internal health statistics.

    • smart Collect SMART statistics, notably load cycle count, temperature and bad sectors.

    • snmp Read values from SNMP (Simple Network Management Protocol) enabled network devices such as switches, routers, thermometers, rack monitoring servers, etc. See collectd-snmp(5).

    • statsd Acts as a StatsD server, reading values sent over the network from StatsD clients and calculating rates and other aggregates out of these values.

    • sysevent Listens to rsyslog events and submits matched values.

    • swap Pages swapped out onto hard disk or whatever is called `swap' by the OS..

    • table Parse table-like structured files.

    • tail Follows (tails) log files, parses them by lines and submits matched values.

    • tail_csv Follows (tails) files in CSV format, parses each line and submits extracted values.

    • tape Bytes and operations read and written on tape devices. Solaris only.

    • tcpconns Number of TCP connections to specific local and remote ports.

    • teamspeak2 TeamSpeak2 server statistics.

    • ted Plugin to read values from `The Energy Detective' (TED).

    • thermal Linux ACPI thermal zone information.

    • tokyotyrant Reads the number of records and file size from a running Tokyo Tyrant server.

    • turbostat Reads CPU frequency and C-state residency on modern Intel turbo-capable processors.

    • ubi Reads the count of bad physical eraseblocks and the current maximum erase counter value on UBI volumes.

    • uptime System uptime statistics.

    • users Users currently logged in.

    • varnish Various statistics from Varnish, an HTTP accelerator.

    • virt CPU, memory, disk and network I/O statistics from virtual machines.

    • vmem Virtual memory statistics, e.g. the number of page-ins/-outs or the number of pagefaults.

    • vserver System resources used by Linux VServers. See http://linux-vserver.org/.

    • wireless Link quality of wireless cards. Linux only.

    • xencpu XEN Hypervisor CPU stats.

    • xmms Bitrate and frequency of music played with XMMS.

    • zfs_arc Statistics for ZFS' “Adaptive Replacement Cache” (ARC).

    • zone Measures the percentage of cpu load per container (zone) under Solaris 10 and higher

    • zookeeper Read data from Zookeeper's MNTR command.

  • Output can be written or sent to various destinations by the following plugins:

    • amqp Sends JSON-encoded data to an Advanced Message Queuing Protocol (AMQP) 0.9.1 server, such as RabbitMQ.

    • amqp1 Sends JSON-encoded data to an Advanced Message Queuing Protocol (AMQP) 1.0 server, such as Qpid Dispatch Router or Apache Artemis Broker.

    • csv Write to comma separated values (CSV) files. This needs lots of diskspace but is extremely portable and can be analysed with almost every program that can analyse anything. Even Microsoft's Excel..

    • grpc Send and receive values over the network using the gRPC framework.

    • lua It's possible to implement write plugins in Lua using the Lua plugin. See collectd-lua(5) for details.

    • mqtt Publishes and subscribes to MQTT topics.

    • network Send the data to a remote host to save the data somehow. This is useful for large setups where the data should be saved by a dedicated machine.

    • perl Of course the values are propagated to plugins written in Perl, too, so you can easily do weird stuff with the plugins we didn't dare think of ;) See collectd-perl(5).

    • python It's possible to implement write plugins in Python using the python plugin. See collectd-python(5) for details.

    • rrdcached Output to round-robin-database (RRD) files using the RRDtool caching daemon (RRDcacheD) - see rrdcached(1). That daemon provides a general implementation of the caching done by the `rrdtool' plugin.

    • rrdtool Output to round-robin-database (RRD) files using librrd. See rrdtool(1). This is likely the most popular destination for such values. Since updates to RRD-files are somewhat expensive this plugin can cache updates to the files and write a bunch of updates at once, which lessens system load a lot.

    • snmp_agent Receives and handles queries from SNMP master agent and returns the data collected by read plugins. Handles requests only for OIDs specified in configuration file. To handle SNMP queries the plugin gets data from collectd and translates requested values from collectd's internal format to SNMP format.

    • unixsock One can query the values from the unixsock plugin whenever they're needed. Please read collectd-unixsock(5) for a description on how that's done.

    • write_graphite Sends data to Carbon, the storage layer of Graphite using TCP or UDP. It can be configured to avoid logging send errors (especially useful when using UDP).

    • write_http Sends the values collected by collectd to a web-server using HTTP POST requests. The transmitted data is either in a form understood by the Exec plugin or formatted in JSON.

    • write_kafka Sends data to Apache Kafka, a distributed queue.

    • write_log Writes data to the log

    • write_mongodb Sends data to MongoDB, a NoSQL database.

    • write_prometheus Publish values using an embedded HTTP server, in a format compatible with Prometheus' collectd_exporter.

    • write_redis Sends the values to a Redis key-value database server.

    • write_riemann Sends data to Riemann, a stream processing and monitoring system.

    • write_sensu Sends data to Sensu, a stream processing and monitoring system, via the Sensu client local TCP socket.

    • write_syslog Sends data in syslog format, using TCP, where the message contains the metric in human or JSON format.

    • write_tsdb Sends data OpenTSDB, a scalable no master, no shared state time series database.

  • Logging is, as everything in collectd, provided by plugins. The following plugins keep us informed about what's going on:

    • logfile Writes log messages to a file or STDOUT/STDERR.

    • perl Log messages are propagated to plugins written in Perl as well. See collectd-perl(5).

    • python It's possible to implement log plugins in Python using the python plugin. See collectd-python(5) for details.

    • syslog Logs to the standard UNIX logging mechanism, syslog.

    • log_logstash Writes log messages formatted as logstash JSON events.

  • Notifications can be handled by the following plugins:

    • notify_desktop Send a desktop notification to a notification daemon, as defined in the Desktop Notification Specification. To actually display the notifications, notification-daemon is required. See http://www.galago-project.org/specs/notification/.

    • notify_email Send an E-mail with the notification message to the configured recipients.

    • notify_nagios Submit notifications as passive check results to a local nagios instance.

    • exec Execute a program or script to handle the notification. See collectd-exec(5).

    • logfile Writes the notification message to a file or STDOUT/STDERR.

    • network Send the notification to a remote host to handle it somehow.

    • perl Notifications are propagated to plugins written in Perl as well. See collectd-perl(5).

    • python It's possible to implement notification plugins in Python using the python plugin. See collectd-python(5) for details.

  • Value processing can be controlled using the "filter chain" infrastructure and "matches" and "targets". The following plugins are available:

    • match_empty_counter Match counter values which are currently zero.

    • match_hashed Match values using a hash function of the hostname.

    • match_regex Match values by their identifier based on regular expressions.

    • match_timediff Match values with an invalid timestamp.

    • match_value Select values by their data sources' values.

    • target_notification Create and dispatch a notification.

    • target_replace Replace parts of an identifier using regular expressions.

    • target_scale Scale (multiply) values by an arbitrary value.

    • target_set Set (overwrite) entire parts of an identifier.

  • Miscellaneous plugins:

    • aggregation Selects multiple value lists based on patterns or regular expressions and creates new aggregated values lists from those.

    • threshold Checks values against configured thresholds and creates notifications if values are out of bounds. See collectd-threshold(5) for details.

    • uuid Sets the hostname to a unique identifier. This is meant for setups where each client may migrate to another physical host, possibly going through one or more name changes in the process.

  • Performance: Since collectd is running as a daemon it doesn't spend much time starting up again and again. With the exception of the exec plugin no processes are forked. Caching in output plugins, such as the rrdtool and network plugins, makes sure your resources are used efficiently. Also, since collectd is programmed multithreaded it benefits from hyper-threading and multicore processors and makes sure that the daemon isn't idle if only one plugin waits for an IO-operation to complete.

  • Once set up, hardly any maintenance is necessary. Setup is kept as easy as possible and the default values should be okay for most users.

Operation

  • collectd's configuration file can be found at sysconfdir'/collectd.conf. Run collectd -h' for a list of built-in defaults. See `collectd.conf(5)' for a list of options and a syntax description.

  • When the csv' or rrdtool' plugins are loaded they'll write the values to files. The usual place for these files is beneath `/var/lib/collectd'.

  • When using some of the plugins, collectd needs to run as user root, since only root can do certain things, such as craft ICMP packages needed to ping other hosts. collectd should NOT be installed setuid root since it can be used to overwrite valuable files!

  • Sample scripts to generate graphs reside in contrib/' in the source package or somewhere near /usr/share/doc/collectd' in most distributions. Please be aware that those script are meant as a starting point for your own experiments.. Some of them require the RRDs' Perl module. (librrds-perl' on Debian) If you have written a more sophisticated solution please share it with us.

  • The RRAs of the automatically created RRD files depend on the step' and heartbeat' settings given. If change these settings you may need to re-create the files, losing all data. Please be aware of that when changing the values and read the rrdtool(1) manpage thoroughly.

collectd and chkrootkit

If you are using the `dns' plugin chkrootkit(1) will report collectd as a packet sniffer (": PACKET SNIFFER(/usr/sbin/collectd[])"). The plugin captures all UDP packets on port 53 to analyze the DNS traffic. In this case, collectd is a legitimate sniffer and the report should be considered to be a false positive. However, you might want to check that this really is collectd and not some other, illegitimate sniffer.

Prerequisites

To compile collectd from source you will need:

  • Usual suspects: C compiler, linker, preprocessor, make, ...

    collectd makes use of some common C99 features, e.g. compound literals and mixed declarations, and therefore requires a C99 compatible compiler.

    On Debian and Ubuntu, the "build-essential" package should pull in everything that's necessary.

  • A POSIX-threads (pthread) implementation. Since gathering some statistics is slow (network connections, slow devices, etc) collectd is parallelized. The POSIX threads interface is being used and should be found in various implementations for hopefully all platforms.

  • When building from the Git repository, flex (tokenizer) and bison (parser generator) are required. Release tarballs include the generated files – you don't need these packages in that case.

  • aerotools-ng (optional) Used by the aquaero' plugin. Currently, the libaquaero5' library, which is used by the aerotools-ng' toolkit, is not compiled as a shared object nor does it feature an installation routine. Therefore, you need to point collectd's configure script at the source directory of the aerotools-ng' project. https://github.com/lynix/aerotools-ng

  • CoreFoundation.framework and IOKit.framework (optional) For compiling on Darwin in general and the `apple_sensors' plugin in particular. http://developer.apple.com/corefoundation/

  • CUDA (optional) Used by the `gpu_nvidia' plugin https://developer.nvidia.com/cuda-downloads

  • libatasmart (optional) Used by the `smart' plugin. http://git.0pointer.de/?p=libatasmart.git

  • libcap (optional) The `turbostat' plugin can optionally build Linux Capabilities support, which avoids full privileges requirement (aka. running as root) to read values. http://sites.google.com/site/fullycapable/

  • libclntsh (optional) Used by the `oracle' plugin.

  • libhiredis (optional) Used by the redis plugin. Please note that you require a 0.10.0 version or higher. https://github.com/redis/hiredis

  • libcurl (optional) If you want to use the apache', ascent', bind', curl', curl_json', curl_xml', nginx', or write_http' plugin. http://curl.haxx.se/

  • libdbi (optional) Used by the `dbi' plugin to connect to various databases. http://libdbi.sourceforge.net/

  • libesmtp (optional) For the `notify_email' plugin. http://www.stafford.uklinux.net/libesmtp/

  • libganglia (optional) Used by the `gmond' plugin to process data received from Ganglia. http://ganglia.info/

  • libgrpc (optional) Used by the `grpc' plugin. gRPC requires a C++ compiler supporting the C++11 standard. https://grpc.io/

  • libgcrypt (optional) Used by the `network' plugin for encryption and authentication. http://www.gnupg.org/

  • libgps (optional) Used by the `gps' plugin. http://developer.berlios.de/projects/gpsd/

  • libi2c-dev (optional) Used for the plugin `barometer', provides just the i2c-dev.h header file for user space i2c development.

  • libiptc (optional) For querying iptables counters. http://netfilter.org/

  • libjansson (optional) Parse JSON data. This is used for the capabilities' and dpdk_telemetry` plugins. http://www.digip.org/jansson/

  • libjevents (optional) The jevents library is used by the `intel_pmu' plugin to access the Linux kernel perf interface. Note: the library should be build with -fPIC flag to be linked with intel_pmu shared object correctly. https://github.com/andikleen/pmu-tools

  • libjvm (optional) Library that encapsulates the Java Virtual Machine' (JVM). This library is used by the java' plugin to execute Java bytecode. See docs/BUILD.java.md for detailed build instructions. http://openjdk.java.net/ (and others)

  • libldap (optional) Used by the `openldap' plugin. http://www.openldap.org/

  • liblua (optional) Used by the `lua' plugin. Currently, Lua 5.1 and later are supported. https://www.lua.org/

  • libmemcached (optional) Used by the `memcachec' plugin to connect to a memcache daemon. http://tangent.org/552/libmemcached.html

  • libmicrohttpd (optional) Used by the write_prometheus plugin to run an http daemon. http://www.gnu.org/software/libmicrohttpd/

  • libmnl (optional) Used by the `netlink' plugin. http://www.netfilter.org/projects/libmnl/

  • libmodbus (optional) Used by the modbus' plugin to communicate with Modbus/TCP devices. The modbus' plugin works with version 2.0.3 of the library – due to frequent API changes other versions may or may not compile cleanly. http://www.libmodbus.org/

  • libmysqlclient (optional) Unsurprisingly used by the `mysql' plugin. http://dev.mysql.com/

  • libnetapp (optional) Required for the `netapp' plugin. This library is part of the “Manage ONTAP SDK” published by NetApp.

  • libnetsnmp (optional) For the `snmp' and 'snmp_agent' plugins. http://www.net-snmp.org/

  • libnetsnmpagent (optional) Required for the 'snmp_agent' plugin. http://www.net-snmp.org/

  • libnotify (optional) For the `notify_desktop' plugin. http://www.galago-project.org/

  • libopenipmi (optional) Used by the `ipmi' plugin to prove IPMI devices. http://openipmi.sourceforge.net/

  • liboping (optional) Used by the `ping' plugin to send and receive ICMP packets. http://octo.it/liboping/

  • libowcapi (optional) Used by the `onewire' plugin to read values from onewire sensors (or the owserver(1) daemon). http://www.owfs.org/

  • libpcap (optional) Used to capture packets by the `dns' plugin. http://www.tcpdump.org/

  • libperfstat (optional) Used by various plugins to gather statistics under AIX.

  • libperl (optional) Obviously used by the `perl' plugin. The library has to be compiled with ithread support (introduced in Perl 5.6.0). http://www.perl.org/

  • libpmwapi (optional) Used by the dcpmm plugin. The library github: https://github.com/intel/intel-pmwatch Follow the pmwatch build instructions mentioned for dcpmm plugin and use the install path to resolve the dependency here.

  • libpq (optional) The PostgreSQL C client library used by the `postgresql' plugin. http://www.postgresql.org/

  • libpqos (optional) The PQoS library for Intel(R) Resource Director Technology used by the `intel_rdt' plugin. https://github.com/01org/intel-cmt-cat

  • libprotobuf, protoc 3.0+ (optional) Used by the `grpc' plugin to generate service stubs and code to handle network packets of collectd's protobuf-based network protocol. https://developers.google.com/protocol-buffers/

  • libprotobuf-c, protoc-c (optional) Used by the `pinba' plugin to generate a parser for the network packets sent by the Pinba PHP extension. http://code.google.com/p/protobuf-c/

  • libpython (optional) Used by the `python' plugin. Currently, Python 2.6 and later and Python 3 are supported. http://www.python.org/

  • libqpid-proton (optional) Used by the `amqp1' plugin for AMQP 1.0 connections, for example to Qdrouterd. http://qpid.apache.org/

  • librabbitmq (optional; also called “rabbitmq-c”) Used by the `amqp' plugin for AMQP 0.9.1 connections, for example to RabbitMQ. http://hg.rabbitmq.com/rabbitmq-c/

  • librdkafka (optional; also called “rdkafka”) Used by the `write_kafka' plugin for producing messages and sending them to a Kafka broker. https://github.com/edenhill/librdkafka

  • librouteros (optional) Used by the routeros' plugin to connect to a device running RouterOS'. http://octo.it/librouteros/

  • librrd (optional) Used by the rrdtool' and rrdcached' plugins. The latter requires RRDtool client support which was added after version 1.3 of RRDtool. Versions 1.0, 1.2 and 1.3 are known to work with the `rrdtool' plugin. http://oss.oetiker.ch/rrdtool/

  • librt, libsocket, libkstat, libdevinfo (optional) Various standard Solaris libraries which provide system functions. http://developers.sun.com/solaris/

  • libsensors (optional) To read from lm_sensors', see the sensors' plugin. http://www.lm-sensors.org/

  • libsigrok (optional) Used by the `sigrok' plugin. In addition, libsigrok depends on glib, libzip, and optionally (depending on which drivers are enabled) on libusb, libftdi and libudev.

  • libslurm (optional) Used by the slurm plugin. https://slurm.schedmd.com/

  • libsqlite3 (optional) Used by the ras plugin. https://sqlite.org/

  • libstatgrab (optional) Used by various plugins to collect statistics on systems other than Linux and/or Solaris. http://www.i-scream.org/libstatgrab/

  • libtokyotyrant (optional) Used by the `tokyotyrant' plugin. http://1978th.net/tokyotyrant/

  • libupsclient/nut (optional) For the nut' plugin which queries nut's upsd'. http://networkupstools.org/

  • libvirt (optional) Collect statistics from virtual machines. http://libvirt.org/

  • libxml2 (optional) Parse XML data. This is needed for the ascent', bind', curl_xml' and virt' plugins. http://xmlsoft.org/

  • libxen (optional) Used by the `xencpu' plugin. http://xenbits.xensource.com/

  • libxmms (optional) http://www.xmms.org/

  • libyajl (optional) Parse JSON data. This is needed for the ceph', curl_json', 'ovs_events', 'ovs_stats' and `log_logstash' plugins. http://github.com/lloyd/yajl

  • libvarnish (optional) Fetches statistics from a Varnish instance. This is needed for the `varnish' plugin. http://varnish-cache.org

  • riemann-c-client (optional) For the `write_riemann' plugin. https://github.com/algernon/riemann-c-client

Configuring / Compiling / Installing

To configure, build and install collectd with the default settings, run ./configure && make && make install'. For a complete list of configure options and their description, run ./configure --help'.

By default, the configure script will check for all build dependencies and disable all plugins whose requirements cannot be fulfilled (any other plugin will be enabled). To enable a plugin, install missing dependencies (see section Prerequisites' above) and rerun configure'. If you specify the --enable-<plugin>' configure option, the script will fail if the depen- dencies for the specified plugin are not met. In that case you can force the plugin to be built using the --enable-=force' configure option. This will most likely fail though unless you're working in a very unusual setup and you really know what you're doing. If you specify the --disable-<plugin>' configure option, the plugin will not be built. If you specify the --enable-all-plugins' or `--disable-all-plugins' configure options, all plugins will be enabled or disabled respectively by default. Explicitly enabling or disabling a plugin overwrites the default for the specified plugin. These options are meant for package maintainers and should not be used in everyday situations.

By default, collectd will be installed into /opt/collectd'. You can adjust this setting by specifying the --prefix' configure option - see INSTALL for details. If you pass DESTDIR= to `make install', will be prefixed to all installation directories. This might be useful when creating packages for collectd.

Generating the configure script

Collectd ships with a build.sh' script to generate the configure' script shipped with releases.

To generate the configure script, you'll need the following dependencies:

  • autoconf
  • automake
  • flex
  • bison
  • libtool
  • pkg-config

The `build.sh' script takes no arguments.

Building on Windows

Collectd can be built on Windows using Cygwin, and the result is a binary that runs natively on Windows. That is, Cygwin is only needed for building, not running, collectd.

You will need to install the following Cygwin packages:

  • automake
  • bison
  • flex
  • git
  • libtool
  • make
  • mingw64-x86_64-dlfcn
  • mingw64-x86_64-gcc-core
  • mingw64-x86_64-zlib
  • pkg-config

To build, just run the `build.sh' script in your Cygwin terminal. By default, it installs to "C:/Program Files/collectd". You can change the location by setting the INSTALL_DIR variable:

$ export INSTALL_DIR="C:/some/other/install/directory" $ ./build.sh

or:

$ INSTALL_DIR="C:/some/other/install/directory" ./build.sh

Crosscompiling

To compile correctly collectd needs to be able to initialize static variables to NAN (Not A Number). Some C libraries, especially the GNU libc, have a problem with that.

Luckily, with GCC it's possible to work around that problem: One can define NAN as being (0.0 / 0.0) and isnan' as f != f'. However, to test this ``implementation'' the configure script needs to compile and run a short test program. Obviously running a test program when doing a cross- compilation is, well, challenging.

If you run into this problem, you can use the `--with-nan-emulation' configure option to force the use of this implementation. We can't promise that the compiled binary actually behaves as it should, but since NANs are likely never passed to the libm you have a good chance to be lucky.

Likewise, collectd needs to know the layout of doubles in memory, in order to craft uniform network packets over different architectures. For this, it needs to know how to convert doubles into the memory layout used by x86. The configure script tries to figure this out by compiling and running a few small test programs. This is of course not possible when cross-compiling. You can use the `--with-fp-layout' option to tell the configure script which conversion method to assume. Valid arguments are:

* `nothing'    (12345678 -> 12345678)
* `endianflip' (12345678 -> 87654321)
* `intswap'    (12345678 -> 56781234)

Contact

Please use GitHub to report bugs and submit pull requests: https://github.com/collectd/collectd/. See CONTRIBUTING.md for details.

For questions, development information and basically all other concerns please send an email to collectd's mailing list at .

For live discussion and more personal contact visit us in IRC, we're in channel #collectd on freenode.

Author

Florian octo Forster , Sebastian tokkee Harl , and many contributors (see `AUTHORS').

collectd's People

Contributors

abays avatar bbczeuz avatar collectd-bot avatar dago avatar darinkes avatar daryder avatar dothebart avatar dougm avatar efuss avatar feandil avatar ffromani avatar kev009 avatar kwiatrox avatar manuelluis avatar marekbecka avatar mrunge avatar octo avatar paul avatar pllopis avatar pyr avatar rjablonx avatar rkorynkx avatar rpv-tomsk avatar rubenk avatar tokkee avatar vincentbernat avatar vmytnykx avatar ymettier avatar zebity avatar zzzyhtheonly avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

collectd's Issues

De-duplicate received network packets

The check_receive_okay() function in the network plugin currently checks if it already sent out the value with a newer timestamp. When, for example, a cluster has multiple forwarding proxies for reliability reasons, each value will arrive twice, resulting in a massive amount of duplicated value lists.

Store a meta-data entry, network:time_received, and only accept a value lists from the network if the time is increasing. Possibly make this configurable if it proves to put pressure on the daemon.

apcups plugin polling issues when non-default interval used

From: Edwin (Mantis #38)

Description: Using collectd 4.10.1-2 (Ubuntu 10.10 Maverick repo)

When changing the collectd interval to 30, apcups plugin always fails polling after the initial poll succeeds. This causes the plugin to be paused and stats not collected.

Syslog entries will look something like:

Jun 15 14:55:28 codis collectd[2607]: apcups plugin: Writing to the socket failed.
Jun 15 14:55:28 codis collectd[2607]: read-function of plugin `apcups' failed. Will suspend it for 60 seconds.
Jun 15 14:56:58 codis collectd[2607]: apcups plugin: Writing to the socket failed.
Jun 15 14:56:58 codis collectd[2607]: read-function of plugin `apcups' failed. Will suspend it for 60 seconds.

Steps To Reproduce: Change collectd interval to 30

Additional Information: This appears to be due to attempting to reuse the network socket and not handling any failures. Workaround is to open a new socket each time.

Patch attached to close the socket everytime. Cleaner patch should probably attempt to reuse the socket if possible and then open a new one on error.

--- apcups.c.orig       2011-06-16 09:56:52.231552800 -0400
+++ apcups.c    2011-06-16 09:56:56.690889806 -0400
@@ -323,6 +323,18 @@
                return (-1);
        }

+       uint16_t packet_size = 0;
+        if (global_sockfd < 0)
+                return (0);
+
+        DEBUG ("Gracefully shutting down socket %i.", global_sockfd);
+
+        /* send EOF sentinel */
+        swrite (global_sockfd, (void *) &packet_size, sizeof (packet_size));
+
+        close (global_sockfd);
+        global_sockfd = -1;
+
        return (0);
 }

collectd: Libgcrypt warning: missing initialization (debian-6.0.3)

hy,
i've deployed collectd on debian 6.0.3 64bit using aptitude, with all dependencies.
collectd seems to have issues with the network plugins, trying to send signed data to a collectd server.

this configuration works perfectly on other distro :

  • debian lenny
  • ubuntu 10.10

in syslog file i have:"
collectd: Libgcrypt warning: missing initialization - please fix the application
collectdmon[20403]: Warning: collectd was terminated by signal 6
collectdmon[20403]: Warning: restarting collectd"

any clues on how to fix this ?

Regards,

Xinity

memcached plugin: Support for multiple instances

From: Remington (Mantis #25)

A lot of places run multiple copies of memcached on one server, in some cases performance goes up having multiple "little" instances of memcache, as apposed to one large instance.

In testing collectd polling multiple sources it appears to only grab the first. Please add support for polling multiple memcached processes.

Libgcrypt warning: missing initialization - network plugin with SecurityLevel Encrypt

Using the following config for the network plugin:

<Server "<IP HERE>" "25826">
                SecurityLevel Encrypt
                Username "user1"
                Password "password1"
#              Interface "eth0"
</Server>

Generates the following warning message when starting collectd:

 Libgcrypt warning: missing initialization - please fix the application

libgcrypt is installed and was detected by `configure' when compiling from source. I may well have missed something obvious when compiling the source but the packages from the repo had the same problem.

CPU plugin fails to load on Mac OS X

From: yozshura (Mantis #32)
OS: Mac OS X Snow Leopard (10.6.7)

Here is excerpt from log file:

[2011-05-20 03:16:13] cpu plugin: host_processors returned 4
[2011-05-20 03:16:13] Initialization of plugin `cpu' failed with status -1. Plugin will be unloaded.
[2011-05-20 03:16:13] Initialization complete, entering read-loop.
[2011-05-20 03:16:13] rrdtool plugin: Adjusting "RandomTimeout" to 0.000 seconds.
[2011-05-20 03:20:01] Exiting normally.

System: Macbook Pro 2011, Snow Leopard 10.6.7 64bit

clang fails in network.c (with -Werror due to tautological compare)

When compiled with clang 3.1, the network plugin fails with:

libtool: compile:  /usr/bin/clang -DHAVE_CONFIG_H -I. -DPREFIX=\"/opt/local\" -DCONFIGFILE=\"/opt/local/etc/collectd.conf\" -DLOCALSTATEDIR=\"/opt/local/var\" -DPKGLOCALSTATEDIR=\"/opt/local/var/lib/collectd\" -DPIDFILE=\"/opt/local/var/run/collectd.pid\" -DPLUGINDIR=\"/opt/local/lib/collectd\" -DPKGDATADIR=\"/opt/local/share/collectd\" -I/opt/local/include -I/opt/local/include -Wall -Werror -pipe -O2 -D_GCRYPT_IN_LIBGCRYPT=1 -arch x86_64 -MT network_la-network.lo -MD -MP -MF .deps/network_la-network.Tpo -c network.c  -fno-common -DPIC -o .libs/network_la-network.o
network.c:708:18: error: comparison of unsigned expression < 0 is always false [-Werror,-Wtautological-compare]
        if ((buffer_len < 0) || (buffer_len < exp_size))
             ~~~~~~~~~~ ^ ~
network.c:793:18: error: comparison of unsigned expression < 0 is always false [-Werror,-Wtautological-compare]
        if ((buffer_len < 0) || ((size_t) buffer_len < exp_size))
             ~~~~~~~~~~ ^ ~
network.c:832:18: error: comparison of unsigned expression < 0 is always false [-Werror,-Wtautological-compare]
        if ((buffer_len < 0) || (buffer_len < header_size))
             ~~~~~~~~~~ ^ ~

Since ISO C99 specifies size_t to be unsigned I think this comparison can safely be dropped:

--- src/network.c.orig  2012-03-10 02:11:29.000000000 +0100
+++ src/network.c   2012-03-10 02:13:01.000000000 +0100
@@ -705,7 +705,7 @@

    exp_size = 3 * sizeof (uint16_t)
        + pkg_numval * (sizeof (uint8_t) + sizeof (value_t));
-   if ((buffer_len < 0) || (buffer_len < exp_size))
+   if (buffer_len < exp_size)
    {
        WARNING ("network plugin: parse_part_values: "
                "Packet too short: "
@@ -790,7 +790,7 @@

    uint16_t pkg_length;

-   if ((buffer_len < 0) || ((size_t) buffer_len < exp_size))
+   if ((size_t) buffer_len < exp_size)
    {
        WARNING ("network plugin: parse_part_number: "
                "Packet too short: "
@@ -829,7 +829,7 @@

    uint16_t pkg_length;

-   if ((buffer_len < 0) || (buffer_len < header_size))
+   if (buffer_len < header_size)
    {
        WARNING ("network plugin: parse_part_string: "
                "Packet too short: "

Problem compiling latest release on Mac OS X 10.7

Here's what I run into while trying to compile the latest release on my Mac laptop:

df.c: In function ‘df_read’:
df.c:257: warning: comparison is always false due to limited range of data type

(and then it errors out)

Known issue?

AMQP plugin build error

From: Xavier (Mantis #51)

The amqp plugin does not compile properly with last version of librabbitmq on Ubuntu 11.10.

Patch that fix the issue:

diff --git a/src/amqp.c b/src/amqp.c
index adf4792..6e69b38 100644
--- a/src/amqp.c
+++ b/src/amqp.c
@@ -178,8 +178,8 @@ static char *camqp_strerror (camqp_config_t *conf, /* {{{ */
             break;

         case AMQP_RESPONSE_LIBRARY_EXCEPTION:
-            if (r.library_errno)
-                return (sstrerror (r.library_errno, buffer, buffer_size));
+            if (r.library_error)
+                return (sstrerror (r.library_error, buffer, buffer_size));
             else
                 sstrncpy (buffer, "End of stream", sizeof (buffer));
             break;
@@ -316,7 +368,8 @@ static int camqp_setup_queue (camqp_config_t *conf) /* {{{ */
             /* consumer_tag = */ AMQP_EMPTY_BYTES,
             /* no_local     = */ 0,
             /* no_ack       = */ 1,
-            /* exclusive    = */ 0);
+            /* exclusive    = */ 0,
+            /* arguments   = */ AMQP_EMPTY_TABLE);
     if ((cm_ret == NULL) && camqp_is_error (conf))
     {
         char errbuf[1024];

bug of "exec plugin:STDERR close"

From: Tetsuya Kawaguchi (Mantis #44)

Description: When using "exec plugin", you might face to the message "exec plugin: Program 'xxxx' has closed STDERR.", Under this condition, collectd will sent SIGTERM to the process which has no relation to collectd. This will happen in collectd's termination sequence.

We think exec_read_one() thread of exec.c has a problem. If there are any child processes to close stderr, the thread will not be closed because it permanently waits for the closed process in the select function.

static void *exec_read_one (void *arg) /* {{{ */
{
  *snip*

  FD_ZERO( &fdset );
  FD_SET(fd, &fdset);
  FD_SET(fd_err, &fdset);

  /* Determine the highest file descriptor */
  highest_fd = (fd > fd_err) ? fd : fd_err;

  /* We use a copy of fdset, as select modifies it */
  copy = fdset;

  while (select(highest_fd + 1, &copy, NULL, NULL, NULL ) > 0)
  {
  *snip*
    if (FD_ISSET(fd, &copy))
    {
    *snip*
    }
    else if (FD_ISSET(fd_err, &copy))
    {
    *snip*
      if (len < 0)
      {
      *snip*
      }
      else if (len == 0)
      {
    /* We've reached EOF */
    NOTICE ("exec plugin: Program `%s' has closed STDERR.",
        pl->exec);
    close (fd_err);

    FD_CLR (fd_err, &fdset);
    highest_fd = fd;
    copy = fdset;    /* <- this line seems to be required. */
    fd_err = -1;
    continue;
      }
  *snip*
}

Because a copy of fdset is used as a parameter in the select function, it is necessary to copy fdset which FD_CLRed.

Steps to reproduce: execute a module like the following from "exec plugin".

#include <stdio.h>

int main( void ){
  fclose( stderr );
  return 0;
}

Process ID remains still on *pl_head of exec plugin (exec.c).

5.1 Build failure for Solaris 10

:(

collectd-5.1.0:cairo> uname -a
SunOS cairo.our.org 5.10 Generic_144488-17 sun4u sparc SUNW,Sun-Fire-280R
collectd-5.1.0:cairo> echo $PATH
/usr/bin:/bin:/usr/sfw/bin:/usr/ccs/bin:/sbin:/usr/sbin
collectd-5.1.0:cairo> ./configure --prefix=/usr/rcf-tools/collectd-5.1.0 --enable-all-plugins
...
collectd-5.1.0:cairo> make 2>&1 | tee make.log
...
nfs.c: In function `nfs_read_kstat':
nfs.c:335: warning: passing arg 2 of `get_kstat_value' discards qualifiers from pointer target type
*** Error code 1
make: Fatal error: Command failed for target `nfs.lo'
...

Add an aggregation plugin

Add a plugin which registers a write and a read callback. It computes configurable aggregations and dispatches them in the read callback.

The configuration could look like this:

<HostList "web_servers">
  Host "/^www[0-9]/"
  Host "proxy"
</HostList>
<PluginList "cpu_total">
  Plugin "cpu" "total"
</PluginList>
<Aggregate>
  HostList "web_servers"
  PluginList "cpu_total"
  Average true
  Sum true
  StdDev false
</Aggregate>

This would generate value lists like:

web_servers/aggregate-cpu_total-average/cpu-idle
web_servers/aggregate-cpu_total-average/cpu-user
...
web_servers/aggregate-cpu_total-sum/cpu-idle
web_servers/aggregate-cpu_total-sum/cpu-user
...

Network plugin: Implement FlushBufferFill option

Implement an option, for example named FlushBufferFill, that specifies to flush the buffer when there are n or more bytes in the buffer. The idea is to have large buffer sizes (~64 kByte), e.g. for large notifications, and still flush whenever 1400 bytes (or so) are in the buffer.

By default, FlushBufferFill should be equal to MaxPacketSize.

SNMP Plugin making wrong interpretation data type

Hello, i am using collectd (4.8.2-1ubuntu0.1) to graph informations from my HP Procurve switches using collectd snmp plugin. One of the data i am collecting is the uptime.

<Plugin snmp>
        <Data "procurve_uptime">
                Type "uptime"
                Table false
                Values ".1.3.6.1.2.1.1.3.0"
                Scale 0.01
        </Data>
        <Host "HP5406zl-2">
                Address "xxx.xxx.xxx.xxx"
                Version 2
                Community "public"
                Collect "procurve_uptime" 
        </Host>
</Plugin>

SysUpTime (.1.3.6.1.2.1.1.3.0) is a 32 bit value and snmp plugin should be able to get value from 0 to 4294967295 (uptime data type is defined like this).

I can get the correct values from most of Procurve Switches (using csv plugini can see positive values) but on somes switches with highest uptime (using snmpwalk i get 2367115384 which is far less than 4294967295) collectd snmp plugin is making a wrong interpretation of the data type and csv plugin shows negatives values.

may this be a bug?.........

thanks

Race condition in perl module.

From: Rrpv (Mantis #47)

I'm started to write my 'new cool plugin' for gathering php-fpm stats using collectd perl module. During my tests I noted what collectd with perl is very unstable. I launch collectd in foreground with simple config (!), and see segfaults too often.

After debugging, I have localized the problem. The problem is due race condition while doing perl_clone() from "base thread".

After initialization and before do_loop() , collectd has INFO ("Initialization complete, entering read-loop."); output. Base thread perl instance gets this log message at perl_log() as plugin has registered appropriate callback. But in the same moment we have Read Threads running, as do_init() is called before this INFO(). Oops, we get race and segfaults.

Some environments can be less affected by this. If configuration have much modules, the read from perl plugin will be slightly later. The logging will be completed at that moment, so perl_clone() will be completed successfully too.

Right now I have no idea how to solve this problem.

The perl plugin needs to be rewriten completely, as I think (because it should register callbacks by modules, not by single bulk as it is done now), but this is hard and long way.

If anybody has ideas, I will work on this (on both simple solve and full module rewrite).

This tested on Debian squeeze 32/64 bit (both), collectd 4.10.1. My config and my perl module are attached to reproduce this.

Proposed patch:

--- perl.c.orig 2010-07-09 17:01:59.000000000 +0700
+++ perl.c      2011-12-11 01:22:09.000000000 +0700
@@ -1968,8 +1968,15 @@

                aTHX = t->interp;
        }
+
+    if (aTHX == perl_threads->head->interp)
+        pthread_mutex_lock (&perl_threads->mutex);

        pplugin_call_all (aTHX_ PLUGIN_LOG, level, msg);
+
+    if (aTHX == perl_threads->head->interp)
+        pthread_mutex_unlock (&perl_threads->mutex);
+
        return;
 } /* static void perl_log (int, const char *) */

patch required to build oracle plugin, collectd-4.10.2

From: Andreas K. Hüttel (Mantis #28)

Description: The attached trivial patch is required on Gentoo to build the oracle plugin, and has been in use on Gentoo for a while now. Please consider integrating.

diff -r -u collectd-4.10.2.orig/configure.in collectd-4.10.2/configure.in
--- collectd-4.10.2.orig/configure.in   2010-11-28 03:27:47.000000000 +0100
+++ collectd-4.10.2/configure.in    2010-11-28 03:28:23.000000000 +0100
@@ -2446,14 +2446,14 @@
 ])
 if test "x$ORACLE_HOME" != "x"
 then
-   with_oracle_cppflags="-I$ORACLE_HOME/rdbms/public"
+   with_oracle_cppflags="-I$ORACLE_HOME/rdbms/public -locci"

    if test -e "$ORACLE_HOME/lib/ldflags"
    then
        with_oracle_libs=`cat "$ORACLE_HOME/lib/ldflags"`
    fi
    #with_oracle_libs="-L$ORACLE_HOME/lib $with_oracle_libs -lclntsh"
-   with_oracle_libs="-L$ORACLE_HOME/lib -lclntsh"
+   with_oracle_libs="-L$ORACLE_HOME/lib -lclntsh -locci"
 fi
 if test "x$with_oracle" = "xyes"
 then

Disk plugin: Mac OS X, disk names?

So running collectd 5.1, on Mac 10.7.3. I configure the disk plugin to find all disks with a block like this:

LoadPlugin disk
<Plugin "disk">
  IgnoreSelected true
</Plugin>

On an Xserve with 3 physical drives, it indeed finds 3 disks. But the names confuse me. In graphite they show up as 14-0, 14-3, and 14-6.

Can you tell me where collectd is getting those names? I can't correlate that to anything in /dev.

rtnl_dump_filter recent API change in iproute2

From: Gaetan Bisson (Mantis #50)

Description: The netlink module uses the rtnl_dump_filter function that iproute2 provides. However in recent iproute2 versions the function syntax changed; it went from:

int rtnl_dump_filter(*rth, *filter, *arg1, *junk, *arg2)

to:

int rtnl_dump_filter(*rth, *filter, *arg1)

The call in netlink.c should therefore be updated; a patch that just does that is attached.

Steps to reproduce: Compile collectd-5.0.2 on a x86_64 system with a recent iproute2 package. It fails with:

netlink.c: In function 'ir_read':
netlink.c:574:2: error: too many arguments to function 'rtnl_dump_filter'
/usr/include/libnetlink.h:40:12: note: declared here
netlink.c:612:6: error: too many arguments to function 'rtnl_dump_filter'
/usr/include/libnetlink.h:40:12: note: declared here

Thresholds prevent collectd from collecting

From: Serge Pawlowicz (Mantis #19)

Description: I have ~6000 rrd files, i keep them in ramfs.

I have just tried thresholds (4.10.1) but it looks when I enable it, network plugin stops accepting submissions from other hosts, and notify sends a lot of email "has not been updated for xxx seconds".

Steps To Reproduce:

<Threshold>
        <Plugin "df">
        <Type "df">
                Percentage true
                WarningMax 90
                FailureMax 95
                DataSource "used"
                Persist false
         </Type>
        </Plugin>
</Threshold>

Collectd use mkdir 755

RRDcached is runned by a non root user.
Collectd create computer, plugin-instance directories and type-instance.rrd file in 755
So RRDCached can't update the rrd files

We need to change mkdir parameter of collectd to 777,
The Init.d script set the umask to 0022

So the user who want other umask will be able to easily change it.

network plugin: messages sent twice

From: koendc (Mantis #37)

Not sure if this is a documentation or application issue.

The docs mention to configure encryption like this:

<Plugin "network">
   Server "collectd.internal.tld"
   <Server "collectd.external.tld">
     SecurityLevel "encrypt"
     Username "myhostname"
     Password "ohl0eQue"
   </Server>
 </Plugin>

When you do this, all messages are sent twice: once encrypted and once not encrypted.

plugin_dispatch_values discards long instance name without warning

From: Fabien Wernli (Mantis #53)

If DATA_MAX_NAME_LEN is reached, plugin_dispatch_values seems to discard type_instance. Tested using postgresql plugin thus maybe linked to that. Here's debug output:

[2012-02-09 16:46:16] db query utils: udb_query_handle_result (billing, impexp): column[1] = pool-XXXXX-YYYYYYY-WWWWWW@myhostname1-YYYY-ZZZZ-OOOOOOO-SSSSSS-WWWWWWW;
[2012-02-09 16:46:16] plugin_dispatch_values: time = 1328802376.547; interval = 120.000; host = myhostname.some.domain; plugin = postgresql; plugin_instance = billing; type = total_requests; type_instance = ;

AMQP plugin: Consumer part of the plugin does not reconnect

From: Xavier (Mantis #52)

Description: Due to a little mistake the AMQP plugin does not reconnect when a connection is lost.
Steps To Reproduce: Restart the AMQP backend and "wait" for Collectd to reconnect → It happens after 10K seconds !!!

Here is a little patch to fix this issue:

@@ -553,7 +555,7 @@ static void *camqp_subscribe_thread (void *user_data) /* {{{ */
             ERROR ("amqp plugin: camqp_connect failed. "
                     "Will sleep for %.3f seconds.",
                     CDTIME_T_TO_DOUBLE (interval_g));
-            sleep (interval_g);
+            sleep ((uint)CDTIME_T_TO_DOUBLE(interval_g));
             continue;
         }

@@ -564,7 +566,7 @@ static void *camqp_subscribe_thread (void *user_data) /* {{{ */
                      "Will sleep for %.3f seconds.",
                     CDTIME_T_TO_DOUBLE (interval_g));
             camqp_close_connection (conf);
-            sleep (interval_g);
+            sleep ((uint)CDTIME_T_TO_DOUBLE(interval_g));
             continue;
         }

python plugin: usage of collectd.Values introduces memory leaks

From: Mike Kazantsev (Mantis #48)

Description: Dispatching collectd.Values introduces memory leaks in collectd daemon.

I've tried using heapy (part of guppy project) to trace the leak ("sys.stderr.write(str(hpy().heap()) + '\n\n')") in the interpreter, but it shows no increase in gc-tracked object count or size, so it looks like either python interpreter isn't responsible for the leak or it's leaky, which is unlikely, since pure-python daemons on the same machines do not leak.

Steps to reproduce: test.conf:

Interval 1

LoadPlugin logfile
<Plugin logfile>
    LogLevel info
    File stderr
    Timestamp true
    PrintSeverity true
</Plugin>

LoadPlugin csv
<Plugin csv>
    DataDir stdout
    StoreRates false
</Plugin>

<LoadPlugin python>
    Globals true
</LoadPlugin>

<Plugin python>
    ModulePath "/etc/collectd"
    Encoding "utf-8"
    LogTraces true
    Interactive false
    Import "testplugin"
</Plugin>

/etc/collectd/testplugin.py:

import collectd

def read(data=None):
    for i in xrange(500):
        collectd.Values( type_instance='test', type='memory',
            plugin='test', plugin_instance='test' ).dispatch(values=[1], time=0)

collectd.register_read(read)

Commandline:

collectd -f -C test.conf >/dev/null &
watch ps u -p $(jobs -p)

Should show RSS increase of about 100 KiB/s. Increasing interval or decreasing per-call dispatch rate just slows the leak, doesn't eliminate it. Calling .dispatch on the same Values object also doesn't help.

Tested with 5.0.1 and latest Git with the same results.

Additional information: Real-world memory usage graph of collectd with python plugins: http://fraggod.net/tmp/collectd_rss.png Had to introduce regular restarts there to mitigate the leak, but it's a bad solution.

Merge mongodb branch

12:28 halkeye: is mongodb not included in the 5.1 release http://collectd.org/wiki/index.php/Plugin:MongoDB
12:29 halkeye: its not in the news, but it does say 5.1 under initial version
14:48 halkeye: octo, is the mongo db plugin supposed to be in release 5.1? or is it going to be in 5.2?
01:58 octo: halkeye: It's in 5.1
10:26 halkeye: octo, how do you enable mongodb then? I don't see it in the man page, or a configure option. I only see write_mongodb plugin, not the reader
10:52 halkeye: octo, also there does't even seem to be a src/mongodb.c file

I'm anxiously awaiting this module, it doesn't look like there have been any commits done on the rc branch since jan, and no outstanding issues I can see on github (maybe elsewhere?) so I was hoping its just an oversight

If its not ready yet, then this can serve as a reminder for later?

processes plugin ignores processes with whitespace in their name (/proc/<PID>/stat)

From: Darrell Bishop (Mantis #43)

Description: When a process changes its name to include whitespace (eg. a space), the parsing code in processes.c, ps_read_process(), splits on that whitespace causing subsequent sanity-checks to fail and the process is ignored. Gunicorn does this, for example:

$ cat /proc/973/stat
973 (gunicorn: maste) S 967 973 967 ...

I have a patch to fix the parsing, but it probably needs some cleanup and more robustness for bogus /proc/<PID>/stat file content.

Steps to reproduce: Have a process with a space in its name. Try to match it with Process or ProcessMatch. Written stats will be zero, as if the process (or processes) were not running.

Additional notes: This is almost certainly a LInux-only problem (since the file in question is /proc/<PID>/stat).

Table of Plugins is Out of Date

The Table of Plugins does not link to all the plugins mentioned in the README. For example, AMQP is missing.

Can this page be autogenerated based on all the pages in Category:Plugins, or does it have to be edited manually? If it needs edited manually, can it be unprotected so that I or someone else can edit it?

PUTNOTIF: Multi-line messages

Make it possible to push long notification messages to collectd. The proposed syntax is:

PUTNOTIF message="This is a very \
very long message that continues in the \
following line"

I.e., when within a double-quoted string and the line ends in a backslash, read the next line and append it to the string. Ideally, this would not be limited by the 1024 byte per-line limit used when parsing lines.

multiple mounts of same mount point makes "df" exclude not to exclude everything

From: Amos Shapira (Mantis #24)

Description: NOTE: This is with collectd 4.10 but there is no such option in the abode "Product Version" drop-down list.

When I exclude certain mount points which appear multiple times in "mount" output from "df", it still tries to report them and fail with errors like:

collectd[21171]: uc_update: Value too old: name = dom0-02.iad.int.threatmetrix.com/df/df-mnt-data-html-centos-5.5-os-x86_64; value time = 1291521882; last cache update = 1291521882;

Steps To Reproduce: Our setup script has a bug in which it appends multiple identical mount points to /etc/fstab, like this:

/mnt/data/html/centos/5.5/CentOS-5.5-x86_64-bin-1of8.iso /mnt/data/html/centos/5.5/os/x86_64 auto loop,ro 0 0
/mnt/data/html/centos/5.5/CentOS-5.5-x86_64-bin-1of8.iso /mnt/data/html/centos/5.5/os/x86_64 auto loop,ro 0 0

I also have a stanza in the collectd configuration which says:

<Plugin "df">
       MountPoint "/dev/shm"
       MountPoint "/mnt/data/html/centos/*"
       IgnoreSelected true
</Plugin>

And we get errors as quoted in the "Description" field.

bind plugin_dispatch_values: Dataset not found: dns_qtype_gauge

From: Justo Alonso (Mantis #35)

Using the bind plugin, we have this error on log:

plugin_dispatch_values: Dataset not found: dns_qtype_gauge

The bind plugin use two times the "dns_qtype_gauge" type not defined on src/types.db (see src/bind.c lines 797 and 834).

Please, change this definition to "dns_qtype" or "dns_qtype_cached" defined into types.db or add the new definition.

5.0.3, interface plugin, if_packet/octets.* coming as counters, not rates

Hi,

I'm running collected 5.0.3 on Mac OS X 10.7.3. The data is being sent by the write_graphte plugin to a graphite installation. When I look at if_octets or if_packets.*, the data steadily increments, hits a limit, and then resets to 0.

How can I get this in bytes/sec, rather than a counter?

Thanks!

write_http blocks all write plugins!

From: Karsten McMinn (Mantis #49)

Description: whenever the write_http plugin is enabled, sending from other plugins that write data breaks.

Steps To Reproduce: setup a collectd proxy using the network plugin, verify data is proxied. enable write_http to a host using JSON format.

network plugin sends a max of one packet a second. perl write plugins don't send anything.

Additional Information: tested on centos with collectd 4.10.3 and 4.10.5

Unable to build/load iptables plugin

On Gentoo, collectd <= 5.0.2 will not load the iptables plugin : https://bugs.gentoo.org/show_bug.cgi?id=375733
5.0.3 will not even allow me to build the module :

checking for iptc_handle_t... no
checking for ip6tc_handle_t... no
checking for iptc_init in -liptc... no
(...)
libiptc . . . . . . . no
(...)
iptables . . . . . . no (dependency error)

There is an issue with the libiptc dependency. I don't know how to help diagnose it any further, but I'd be glad to help.

Curl: Support "multikey" types

In some cases, it would be preferable to store multiple data points for a source rather than "key:value". A example could be polling the php-fpm status page, where a config example might look like:

LoadPlugin curl_json
<Plugin curl_json>
<URL "http://127.0.0.1/_fpmstatus?json">
  Instance "fpm"
  <Key "accepted conn">
      Type "http_requests"
  </Key>
  <Key "listen queue len">
      Type "listen_queue"
  </Key>
  <Key "active processes">
      Type "active_processes"
  </Key>
  <Key "total processes">
      Type "total_processes"
  </Key>
</URL>
</Plugin>

What you'd optimally want here is storing queue len, active processes and total processes in one rrd, for instance similar to the processes plugin.

swap plugin unable to report swap_io

From: J Devenish (Mantis #18)

Description: is a string comparison logic error in src/swap.c which means it never records the actual values of pswpin (swap_io-in) or pswpout (swap_io-out).

Discussion:

Rrpv: I can confirm that bug and solution proposed.

On mine systems "cat /proc/vmstat" shows "unevictable_pgs_mlockfreed 0" as a last string, thats why both 'swap_in' and 'swap_out' values are equal to zero in mostly cases. The first, 'swap_in', is zero because the "unevictable_pgs_mlockfreed" counter grows rarely, and the second is zero because appropriate code is not reachable due wrong condition.

I think this patch need to be committed.


Rrpv: Additionaly, on my Linux system, page is 4k size, so multiplication is needed.

-swap_submit ("in",  swap_in,  DS_TYPE_DERIVE);
-swap_submit ("out", swap_out, DS_TYPE_DERIVE);
+swap_submit ("in",  4096 * swap_in,  DS_TYPE_DERIVE);
+swap_submit ("out", 4096 * swap_out, DS_TYPE_DERIVE);

But I do not know, how the page size should be defined in the common case.

Makefile adds dependency on $(LIBLTDL), which is valued "-lltdl"

When building on OS X, the collectd build failed, because the collectd target has a dependency on "-lltdl", which is the value the variable $(LIBLTDL) has. Obviously, this should be the file name instead. I am however not sure how to specify the correct filename in this case.

The following patch removes the erroneous dependency, which fixed the build for me:

--- src/Makefile.am.orig    2012-03-10 02:30:26.000000000 +0100
+++ src/Makefile.am 2012-03-10 02:30:32.000000000 +0100
@@ -85,7 +85,7 @@

 if BUILD_WITH_OWN_LIBOCONFIG
 collectd_LDADD += $(LIBLTDL) liboconfig/liboconfig.la
-collectd_DEPENDENCIES += $(LIBLTDL) liboconfig/liboconfig.la
+collectd_DEPENDENCIES += liboconfig/liboconfig.la
 else
 collectd_LDADD += -loconfig
 endif

GenericJMX doesn't inherit hostname

Hello,

With the GenericJMX plugin you have to manually specify the host as part of the connection docs.

Other plugins get the host value from CollectD and whatever convention has been configured (which in turn gets the value from the OS).

This causes problems with instances that don't keep their hostname between reboots, such as AWS etc. It also means you have to hardcode the value which means repeating yourself and increases likelihood of inconsistency.

So, it would be preferable if the host was removed and the plugin used the same value as the rest of collectd.

Thanks
Peter Gillard-Moss

Add informal notification severity

Add a severity for notifications, that imply a "FYI" nature, for example the kernel version.

Possible names for such a severity would be "FYI" or "INFO", for example.

python plugin fails on Mac OS X 10.7.2

From running configure:

checking for Python CPPFLAGS... /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7
checking Python.h usability... yes
checking Python.h presence... yes
checking for Python.h... yes
checking for Python LDFLAGS... /System/Library/Frameworks/Python.framework/Versions/2.7/lib
checking for Python LIBS... failed with status 0 (output: )

Python plugin: Can't resolve object from lxml

From: Dennis (Mantis #23)

Description: As soon as I include the following line

from lxml include etree

the plugin won't load and reports:

Unhandled python exception in importing module: \
  ImportError: /usr/lib/python2.6/dist-packages/lxml/objectify.so: \
  undefined symbol: PyExc_BaseException

Running the plugin standalone (with all collectd depending stuff disabled, but lxml.etree still enabled) however works well.

Steps To Reproduce: add the following:

from lxml include etree

Dispatch threads

Separate read and write threads by having a "dispatch queue" and a "dispatch thread pool" in addition to the read thread pool.

There are problems for the network plugin, for example, when a lot of values are coming in and new RRD files need to be generated. Because creating RRD files is relatively slow, the receive queue is growing during that time and blocking other metrics to be written.

An alternative would be to have multiple parse and dispatch threads in the network plugin, but having this as write threads is more generic.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.