From: Florian Forster Date: Fri, 12 Jul 2013 16:23:20 +0000 (+0200) Subject: Merge branch 'collectd-5.3' X-Git-Tag: collectd-5.4.0~23 X-Git-Url: https://git.tokkee.org/?p=collectd.git;a=commitdiff_plain;h=38d06a8f868293466f4eee943555c65457a5e560;hp=bc389fa32a48a64306f7ec008f4548f05fdb7c80 Merge branch 'collectd-5.3' Conflicts: src/collectd.conf.pod --- diff --git a/AUTHORS b/AUTHORS index 45645d1a..adb74813 100644 --- a/AUTHORS +++ b/AUTHORS @@ -47,6 +47,9 @@ Bruno Prémont especially a nasty bug in the network plugin. - Wireshark dissector. +Chad Malfait + - LVM plugin. + Chris Lundquist - Improvements to the write_mongodb plugin. @@ -73,6 +76,9 @@ Doug MacEachern Edward “Koko” Konetzko - fscache plugin. +Evan Felix + - mic plugin. + Fabian Linzberger - Percentage aggregation for `collectd-nagios'. @@ -88,6 +94,9 @@ Franck Lombardi Jason Pepas - nfs plugin. +J. Javier Maestro + - Write-Graphite plugin: UDP support and LogSendErrors flag. + Jérôme Renard - varnish plugin. @@ -126,6 +135,7 @@ Michael Hanselmann Michael Stapelberg - OpenBSD port of the tcpconns plugin. + - cgroups plugin. Michał Mirosław - thermal plugin. @@ -219,6 +229,9 @@ Tommie Gannert Vincent Stehlé - hddtemp plugin. +Xin Li + - FreeBSD port of the ZFS-ARC plugin. + collectd is available at: diff --git a/README b/README index c3c45472..3f65963a 100644 --- a/README +++ b/README @@ -37,6 +37,9 @@ Features Name server and resolver statistics from the `statistics-channel' interface of BIND 9.5, 9,6 and later. + - cgroups + CPU accounting information for process groups under Linux. + - conntrack Number of nf_conntrack entries. @@ -135,6 +138,10 @@ Features - libvirt CPU, memory, disk and network I/O statistics from virtual machines. + - 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. @@ -158,6 +165,10 @@ Features 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. + - modbus Reads values from Modbus/TCP enabled devices. Supports reading values from multiple "slaves" so gateway devices can be used. @@ -376,7 +387,9 @@ Features done. - write_graphite - Sends data to Carbon, the storage layer of 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 diff --git a/configure.in b/configure.in index a62d608b..27c6cd31 100644 --- a/configure.in +++ b/configure.in @@ -78,6 +78,10 @@ case $host_os in AC_DEFINE([KERNEL_AIX], 1, [True if program is to be compiled for a AIX kernel]) ac_system="AIX" ;; + *freebsd*) + AC_DEFINE([KERNEL_FREEBSD], 1, [True if program is to be compiled for a FreeBSD kernel]) + ac_system="FreeBSD" + ;; *) ac_system="unknown" esac @@ -1362,6 +1366,8 @@ fi m4_divert_once([HELP_WITH], [ collectd additional packages:]) +AM_CONDITIONAL([BUILD_FREEBSD],[test "x$x$ac_system" = "xFreeBSD"]) + AM_CONDITIONAL([BUILD_AIX],[test "x$x$ac_system" = "xAIX"]) if test "x$ac_system" = "xAIX" @@ -2152,6 +2158,58 @@ AC_SUBST(JAVA_LIBS) AM_CONDITIONAL(BUILD_WITH_JAVA, test "x$with_java" = "xyes") # }}} +# --with-liblvm2app {{{ +with_liblvm2app_cppflags="" +with_liblvm2app_ldflags="" +AC_ARG_WITH(liblvm2app, [AS_HELP_STRING([--with-liblvm2app@<:@=PREFIX@:>@], [Path to liblvm2app.])], +[ + if test "x$withval" != "xno" && test "x$withval" != "xyes" + then + with_liblvm2app_cppflags="-I$withval/include" + with_liblvm2app_ldflags="-L$withval/lib" + with_liblvm2app="yes" + else + with_liblvm2app="$withval" + fi +], +[ + with_liblvm2app="yes" +]) +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_init, [with_liblvm2app="yes"], [with_liblvm2app="no (Symbol 'lvm_init' 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" + AC_SUBST(BUILD_WITH_LIBLVM2APP_CPPFLAGS) + AC_SUBST(BUILD_WITH_LIBLVM2APP_LDFLAGS) + AC_SUBST(BUILD_WITH_LIBLVM2APP_LIBS) + AC_DEFINE(HAVE_LIBLVM2APP, 1, [Define if liblvm2app is present and usable.]) +fi +AM_CONDITIONAL(BUILD_WITH_LIBLVM2APP, test "x$with_liblvm2app" = "xyes") +# }}} + # --with-libmemcached {{{ with_libmemcached_cppflags="" with_libmemcached_ldflags="" @@ -4152,6 +4210,63 @@ fi AM_CONDITIONAL(BUILD_WITH_LIBYAJL, test "x$with_libyajl" = "xyes") # }}} +# --with-mic {{{ +with_mic_cflags="-I/opt/intel/mic/sysmgmt/sdk/include" +with_mic_ldpath="-L/opt/intel/mic/sysmgmt/sdk/lib/Linux" +with_mic_libs="" +AC_ARG_WITH(mic,[AS_HELP_STRING([--with-mic@<:@=PREFIX@:>@], [Path to Intel MIC Access API.])], +[ + if test "x$withval" = "xno" + then + with_mic="no" + else if test "x$withval" = "xyes" + then + with_mic="yes" + else if test -d "$with_mic/lib" + then + AC_MSG_NOTICE([Not checking for Intel Mic: Manually configured]) + with_mic_cflags="-I$withval/include" + with_mic_ldpath="-L$withval/lib/Linux" + with_mic_libs="-lMicAccessSDK -lscif -lpthread" + with_mic="yes" + fi; fi; fi +], +[with_mic="yes"]) +if test "x$with_mic" = "xyes" +then + SAVE_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $with_mic_cflags" + AC_CHECK_HEADERS(MicAccessApi.h,[],[with_mic="no (MicAccessApi not found)"]) + CPPFLAGS="$SAVE_CPPFLAGS" +fi +if test "x$with_mic" = "xyes" +then + SAVE_CPPFLAGS="$CPPFLAGS" + SAVE_LDFLAGS="$LDFLAGS" + + CPPFLAGS="$CPPFLAGS $with_mic_cflags" + LDFLAGS="$LDFLAGS $with_mic_ldpath" + + AC_CHECK_LIB(MicAccessSDK, MicInitAPI, + [with_mic_ldpath="$with_mic_ldpath" + with_mic_libs="-lMicAccessSDK -lscif -lpthread"], + [with_mic="no (symbol MicInitAPI not found)"],[-lscif -lpthread]) + + CPPFLAGS="$SAVE_CPPFLAGS" + LDFLAGS="$SAVE_LDFLAGS" +fi + +if test "x$with_mic" = "xyes" +then + BUILD_WITH_MIC_CPPFLAGS="$with_mic_cflags" + BUILD_WITH_MIC_LIBPATH="$with_mic_ldpath" + BUILD_WITH_MIC_LDADD="$with_mic_libs" + AC_SUBST(BUILD_WITH_MIC_CPPFLAGS) + AC_SUBST(BUILD_WITH_MIC_LIBPATH) + AC_SUBST(BUILD_WITH_MIC_LDADD) +fi +#}}} + # --with-libvarnish {{{ with_libvarnish_cppflags="" with_libvarnish_cflags="" @@ -4578,6 +4693,7 @@ dependency_error="no" plugin_ascent="no" plugin_battery="no" plugin_bind="no" +plugin_cgroups="no" plugin_conntrack="no" plugin_contextswitch="no" plugin_cpu="no" @@ -4621,6 +4737,7 @@ then plugin_battery="yes" plugin_conntrack="yes" plugin_contextswitch="yes" + plugin_cgroups="yes" plugin_cpu="yes" plugin_cpufreq="yes" plugin_disk="yes" @@ -4629,6 +4746,7 @@ then plugin_interface="yes" plugin_irq="yes" plugin_load="yes" + plugin_lvm="yes" plugin_memory="yes" plugin_nfs="yes" plugin_numa="yes" @@ -4668,6 +4786,14 @@ then plugin_tcpconns="yes" fi +# FreeBSD + +if test "x$ac_system" = "xFreeBSD" +then + plugin_zfs_arc="yes" +fi + + if test "x$with_perfstat" = "xyes" then plugin_cpu="yes" @@ -4903,6 +5029,7 @@ AC_PLUGIN([csv], [yes], [CSV output plugin]) AC_PLUGIN([curl], [$with_libcurl], [CURL generic web statistics]) AC_PLUGIN([curl_json], [$plugin_curl_json], [CouchDB statistics]) AC_PLUGIN([curl_xml], [$plugin_curl_xml], [CURL generic xml statistics]) +AC_PLUGIN([cgroups], [$plugin_cgroups], [CGroups CPU usage accounting]) AC_PLUGIN([dbi], [$with_libdbi], [General database statistics]) AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics]) AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics]) @@ -4925,6 +5052,7 @@ AC_PLUGIN([libvirt], [$plugin_libvirt], [Virtual machine statistics]) AC_PLUGIN([load], [$plugin_load], [System load]) AC_PLUGIN([logfile], [yes], [File logging plugin]) AC_PLUGIN([lpar], [$with_perfstat], [AIX logical partitions statistics]) +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]) @@ -4936,6 +5064,7 @@ AC_PLUGIN([md], [$have_linux_raid_md_u_h], [md (Linux software RAID) de AC_PLUGIN([memcachec], [$with_libmemcached], [memcachec statistics]) AC_PLUGIN([memcached], [yes], [memcached statistics]) AC_PLUGIN([memory], [$plugin_memory], [Memory usage]) +AC_PLUGIN([mic], [$with_mic], [Intel Many Integrated Core stats]) AC_PLUGIN([modbus], [$with_libmodbus], [Modbus plugin]) AC_PLUGIN([multimeter], [$plugin_multimeter], [Read multimeter values]) AC_PLUGIN([mysql], [$with_libmysql], [MySQL statistics]) @@ -5171,6 +5300,7 @@ cat <delivery_mode = CAMQP_DM_VOLATILE; conf->store_rates = 0; + conf->graphite_flags = 0; /* publish & graphite only */ conf->prefix = NULL; conf->postfix = NULL; @@ -942,6 +943,12 @@ static int camqp_config_connection (oconfig_item_t *ci, /* {{{ */ } else if ((strcasecmp ("Format", child->key) == 0) && publish) status = camqp_config_set_format (child, conf); + else if ((strcasecmp ("GraphiteSeparateInstances", child->key) == 0) && publish) + status = cf_util_get_flag (child, &conf->graphite_flags, + GRAPHITE_SEPARATE_INSTANCES); + else if ((strcasecmp ("GraphiteAlwaysAppendDS", child->key) == 0) && publish) + status = cf_util_get_flag (child, &conf->graphite_flags, + GRAPHITE_ALWAYS_APPEND_DS); else if ((strcasecmp ("GraphitePrefix", child->key) == 0) && publish) status = cf_util_get_string (child, &conf->prefix); else if ((strcasecmp ("GraphitePostfix", child->key) == 0) && publish) diff --git a/src/cgroups.c b/src/cgroups.c new file mode 100644 index 00000000..ffb1740a --- /dev/null +++ b/src/cgroups.c @@ -0,0 +1,251 @@ +/** + * collectd - src/cgroups.c + * Copyright (C) 2011 Michael Stapelberg + * Copyright (C) 2013 Florian Forster + * + * 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: + * Michael Stapelberg + * Florian Forster + **/ + +#include "collectd.h" +#include "common.h" +#include "plugin.h" +#include "configfile.h" +#include "utils_mount.h" +#include "utils_ignorelist.h" + +static char const *config_keys[] = +{ + "CGroup", + "IgnoreSelected" +}; +static int config_keys_num = STATIC_ARRAY_SIZE (config_keys); + +static ignorelist_t *il_cgroup = NULL; + +__attribute__ ((nonnull(1))) +__attribute__ ((nonnull(2))) +static void cgroups_submit_one (char const *plugin_instance, + char const *type_instance, value_t value) +{ + value_list_t vl = VALUE_LIST_INIT; + + vl.values = &value; + vl.values_len = 1; + sstrncpy (vl.host, hostname_g, sizeof (vl.host)); + sstrncpy (vl.plugin, "cgroups", sizeof (vl.plugin)); + sstrncpy (vl.plugin_instance, plugin_instance, + sizeof (vl.plugin_instance)); + sstrncpy (vl.type, "cpu", sizeof (vl.type)); + sstrncpy (vl.type_instance, type_instance, + sizeof (vl.type_instance)); + + plugin_dispatch_values (&vl); +} /* void cgroups_submit_one */ + +/* + * This callback reads the user/system CPU time for each cgroup. + */ +static int read_cpuacct_procs (const char *dirname, char const *cgroup_name, + void *user_data) +{ + char abs_path[PATH_MAX]; + struct stat statbuf; + char buf[1024]; + int status; + + FILE *fh; + + if (ignorelist_match (il_cgroup, cgroup_name)) + return (0); + + ssnprintf (abs_path, sizeof (abs_path), "%s/%s", dirname, cgroup_name); + + status = lstat (abs_path, &statbuf); + if (status != 0) + { + ERROR ("cgroups plugin: stat (\"%s\") failed.", + abs_path); + return (-1); + } + + /* We are only interested in directories, so skip everything else. */ + if (!S_ISDIR (statbuf.st_mode)) + return (0); + + ssnprintf (abs_path, sizeof (abs_path), "%s/%s/cpuacct.stat", + dirname, cgroup_name); + fh = fopen (abs_path, "r"); + if (fh == NULL) + { + char errbuf[1024]; + ERROR ("cgroups pluign: fopen (\"%s\") failed: %s", + abs_path, + sstrerror (errno, errbuf, sizeof (errbuf))); + return (-1); + } + + while (fgets (buf, sizeof (buf), fh) != NULL) + { + char *fields[8]; + int numfields = 0; + char *key; + size_t key_len; + value_t value; + + /* Expected format: + * + * user: 12345 + * system: 23456 + */ + strstripnewline (buf); + numfields = strsplit (buf, fields, STATIC_ARRAY_SIZE (fields)); + if (numfields != 2) + continue; + + key = fields[0]; + key_len = strlen (key); + if (key_len < 2) + continue; + + /* Strip colon off the first column */ + if (key[key_len - 1] != ':') + continue; + key[key_len - 1] = 0; + + status = parse_value (fields[1], &value, DS_TYPE_DERIVE); + if (status != 0) + continue; + + cgroups_submit_one (cgroup_name, key, value); + } + + fclose (fh); + return (0); +} /* int read_cpuacct_procs */ + +/* + * Gets called for every file/folder in /sys/fs/cgroup/cpu,cpuacct (or + * whereever cpuacct is mounted on the system). Calls walk_directory with the + * read_cpuacct_procs callback on every folder it finds, such as "system". + */ +static int read_cpuacct_root (const char *dirname, const char *filename, + void *user_data) +{ + char abs_path[PATH_MAX]; + struct stat statbuf; + int status; + + ssnprintf (abs_path, sizeof (abs_path), "%s/%s", dirname, filename); + + status = lstat (abs_path, &statbuf); + if (status != 0) + { + ERROR ("cgroups plugin: stat (%s) failed.", abs_path); + return (-1); + } + + if (S_ISDIR (statbuf.st_mode)) + { + status = walk_directory (abs_path, read_cpuacct_procs, + /* user_data = */ NULL, + /* include_hidden = */ 0); + return (status); + } + + return (0); +} + +static int cgroups_init (void) +{ + if (il_cgroup == NULL) + il_cgroup = ignorelist_create (1); + + return (0); +} + +static int cgroups_config (const char *key, const char *value) +{ + cgroups_init (); + + if (strcasecmp (key, "CGroup") == 0) + { + if (ignorelist_add (il_cgroup, value)) + return (1); + return (0); + } + else if (strcasecmp (key, "IgnoreSelected") == 0) + { + if (IS_TRUE (value)) + ignorelist_set_invert (il_cgroup, 0); + else + ignorelist_set_invert (il_cgroup, 1); + return (0); + } + + return (-1); +} + +static int cgroups_read (void) +{ + cu_mount_t *mnt_list; + cu_mount_t *mnt_ptr; + _Bool cgroup_found = 0; + + mnt_list = NULL; + if (cu_mount_getlist (&mnt_list) == NULL) + { + ERROR ("cgroups plugin: cu_mount_getlist failed."); + return (-1); + } + + for (mnt_ptr = mnt_list; mnt_ptr != NULL; mnt_ptr = mnt_ptr->next) + { + /* Find the cgroup mountpoint which contains the cpuacct + * controller. */ + if (strcmp(mnt_ptr->type, "cgroup") != 0 || + !cu_mount_getoptionvalue(mnt_ptr->options, "cpuacct")) + continue; + + walk_directory (mnt_ptr->dir, read_cpuacct_root, + /* user_data = */ NULL, + /* include_hidden = */ 0); + cgroup_found = 1; + /* It doesn't make sense to check other cpuacct mount-points + * (if any), they contain the same data. */ + break; + } + + cu_mount_freelist (mnt_list); + + if (!cgroup_found) + { + WARNING ("cgroups plugin: Unable to find cgroup " + "mount-point with the \"cpuacct\" option."); + return (-1); + } + + return (0); +} /* int cgroup_read */ + +void module_register (void) +{ + plugin_register_config ("cgroups", cgroups_config, + config_keys, config_keys_num); + plugin_register_init ("cgroups", cgroups_init); + plugin_register_read ("cgroups", cgroups_read); +} /* void module_register */ diff --git a/src/collectd.conf.in b/src/collectd.conf.in index 5af15684..f4ac81a0 100644 --- a/src/collectd.conf.in +++ b/src/collectd.conf.in @@ -17,6 +17,13 @@ #PluginDir "@libdir@/@PACKAGE_NAME@" #TypesDB "@prefix@/share/@PACKAGE_NAME@/types.db" +#----------------------------------------------------------------------------# +# When enabled, plugins are loaded automatically with the default options # +# when an appropriate block is encountered. # +# Disabled by default. # +#----------------------------------------------------------------------------# +#AutoLoadPlugin false + #----------------------------------------------------------------------------# # Interval at which to query values. This may be overwritten on a per-plugin # # base by using the 'Interval' option of the LoadPlugin block: # @@ -72,6 +79,7 @@ #@BUILD_PLUGIN_BIND_TRUE@LoadPlugin bind #@BUILD_PLUGIN_CONNTRACK_TRUE@LoadPlugin conntrack #@BUILD_PLUGIN_CONTEXTSWITCH_TRUE@LoadPlugin contextswitch +#@BUILD_PLUGIN_CGROUPS_TRUE@LoadPlugin cgroups @BUILD_PLUGIN_CPU_TRUE@@BUILD_PLUGIN_CPU_TRUE@LoadPlugin cpu #@BUILD_PLUGIN_CPUFREQ_TRUE@LoadPlugin cpufreq @LOAD_PLUGIN_CSV@LoadPlugin csv @@ -99,6 +107,7 @@ #@BUILD_PLUGIN_LIBVIRT_TRUE@LoadPlugin libvirt @BUILD_PLUGIN_LOAD_TRUE@@BUILD_PLUGIN_LOAD_TRUE@LoadPlugin load #@BUILD_PLUGIN_LPAR_TRUE@LoadPlugin lpar +#@BUILD_PLUGIN_LVM_TRUE@LoadPlugin lvm #@BUILD_PLUGIN_MADWIFI_TRUE@LoadPlugin madwifi #@BUILD_PLUGIN_MBMON_TRUE@LoadPlugin mbmon #@BUILD_PLUGIN_MD_TRUE@LoadPlugin md @@ -156,6 +165,7 @@ #@BUILD_PLUGIN_USERS_TRUE@LoadPlugin users #@BUILD_PLUGIN_UUID_TRUE@LoadPlugin uuid #@BUILD_PLUGIN_VARNISH_TRUE@LoadPlugin varnish +#@BUILD_PLUGIN_MIC_TRUE@LoadPlugin mic #@BUILD_PLUGIN_VMEM_TRUE@LoadPlugin vmem #@BUILD_PLUGIN_VSERVER_TRUE@LoadPlugin vserver #@BUILD_PLUGIN_WIRELESS_TRUE@LoadPlugin wireless @@ -1026,6 +1036,24 @@ # UUIDFile "/etc/uuid" # +# +# ShowCPU true +# ShowCPUCores true +# ShowMemory true +# ShowTemperatures true +## Temperature Sensors can be ignored/shown by repeated #Temperature lines, and +## then inverted with a IgnoreSelectedTemperature. +## Known Temperature sensors: die, devmem, fin, fout, vccp, vddg, vddq +# Temperature vddg +# IgnoreSelectedTemperature true +# ShowPower true +## Power Sensors can be ignored/shown by repeated #Power lines, and +## then inverted with a IgnoreSelectedTemperature. +## Known Temperature sensors: total0, total1, inst, imax, pci3, c2x3, c2x4, vccp, vddg, vddq +# Power total1 +# IgnoreSelectedPower true +# + # # This tag support an argument if you want to # monitor the local instance just use @@ -1034,15 +1062,23 @@ # # CollectCache true # CollectBackend true +# CollectBan false # Varnish 3 only # CollectConnections true +# CollectDirectorDNS false # Varnish 3 only # CollectSHM true # CollectESI false # CollectFetch false # CollectHCB false -# CollectSMA false +# CollectObjects false +# CollectPurge false # Varnish 2 only +# CollectSession false +# CollectSMA false # Varnish 2 only # CollectSMS false -# CollectSM false +# CollectSM false # Varnish 2 only +# CollectStruct false # CollectTotals false +# CollectUptime false +# CollectVCL false # CollectWorkers false # # @@ -1055,6 +1091,8 @@ # # Host "localhost" # Port "2003" +# Protocol "udp" +# LogSendErrors true # Prefix "collectd" # Postfix "collectd" # StoreRates true diff --git a/src/collectd.conf.pod b/src/collectd.conf.pod index 0a2a5f77..ddf3ac60 100644 --- a/src/collectd.conf.pod +++ b/src/collectd.conf.pod @@ -70,17 +70,33 @@ directory for the daemon. =item B I -Loads the plugin I. There must be at least one such line or B -will be mostly useless. +Loads the plugin I. This is required to load plugins, unless the +B option is enabled (see below). Without any loaded plugins, +I will be mostly useless. -Starting with collectd 4.9, this may also be a block in which further options -affecting the behavior of B may be specified. The following -options are allowed inside a B block: +Only the first B statement or block for a given plugin name has any +effect. This is useful when you want to split up the configuration into smaller +files and want each file to be "self contained", i.e. it contains a B +block I then appropriate B statement. The downside is that if +you have multiple conflicting B blocks, e.g. when they specify +different intervals, only one of them (the first one encountered) will take +effect and all others will be silently ignored. - - Globals true - Interval 10 - +B may either be a simple configuration I or a I +with additional options, affecting the behavior of B. A simple +statement looks like this: + + LoadPlugin "cpu" + +Options inside a B block can override default settings and +influence the way plugins are loaded, e.g.: + + + Globals true + Interval 60 + + +The following options are valid inside B blocks: =over 4 @@ -111,7 +127,20 @@ interval, that setting will take precedence. =back -=item B I +=item B B|B + +When set to B (the default), each plugin needs to be loaded explicitly, +using the B statement documented above. If a +BPluginE...E> block is encountered and no configuration +handling callback for this plugin has been registered, a warning is logged and +the block is ignored. + +When set to B, explicit B statements are not required. Each +BPluginE...E> block acts as if it was immediately preceded by a +B statement. B statements are still required for +plugins that don't provide any configuration, e.g. the I. + +=item B I [I] If I points to a file, includes that file. If I points to a directory, recursively includes all files within that directory and its @@ -868,6 +897,29 @@ By default no detailed zone information is collected. =back +=head2 Plugin C + +This plugin collects the CPU user/system time for each I by reading the +F files in the first cpuacct-mountpoint (typically +F on machines using systemd). + +=over 4 + +=item B I + +Select I based on the name. Whether only matching I are +collected or if they are ignored is controlled by the B option; +see below. + +=item B B|B + +Invert the selection: If set to true, all cgroups I the ones that +match any one of the criteria are collected. By default only selected +cgroups are collected if a selection is made. If no selection is configured +at all, B cgroups are selected. + +=back + =head2 Plugin C This plugin doesn't have any options. It reads @@ -1475,6 +1527,20 @@ Enable this option if inodes are a scarce resource for you, usually because many small files are stored on the disk. This is a usual scenario for mail transfer agents and web caches. +=item B B|B + +Enables or disables reporting of free, used and used disk space in 1K-blocks. +Defaults to true. + +=item B B|B + +Enables or disables reporting of free, used and used disk space in percentage. +Defaults to false. + +This is useful for deploying collectd on the cloud, where machines with +different disk size may exist. Then it is more practical to configure thresholds +based on relative disk size. + =back =head2 Plugin C @@ -2223,7 +2289,7 @@ interpreted. For a description of match blocks, please see L<"Plugin tail">. =head2 Plugin C -The C connects to a memcached server and queries statistics +The B connects to a memcached server and queries statistics about cache utilization, memory and bandwidth used. L @@ -2255,6 +2321,166 @@ setting is given, the B and B settings are ignored. =back +=head2 Plugin C + +The B gathers CPU statistics, memory usage and temperatures from +Intel's Many Integrated Core (MIC) systems. + +B + + + ShowCPU true + ShowCPUCores true + ShowMemory true + + ShowTemperatures true + Temperature vddg + Temperature vddq + IgnoreSelectedTemperature true + + ShowPower true + Power total0 + Power total1 + IgnoreSelectedPower true + + +The following options are valid inside the Bmic> block: + +=over 4 + +=item B B|B + +If enabled (the default) a sum of the CPU usage accross all cores is reported. + +=item B B|B + +If enabled (the default) per-core CPU usage is reported. + +=item B B|B + +If enabled (the default) the physical memory usage of the MIC system is +reported. + +=item B B|B + +If enabled (the default) various temperatures of the MIC system are reported. + +=item B I + +This option controls which temperatures are being reported. Whether matching +temperatures are being ignored or I matching temperatures are reported +depends on the B setting below. By default I +temperatures are reported. + +=item B B|B + +Controls the behavior of the B setting above. If set to B +(the default) only temperatures matching a B option are reported +or, if no B option is specified, all temperatures are reported. If +set to B, matching temperatures are I and all other temperatures +are reported. + +Known temperature names are: + +=over 4 + +=item die + +Die of the CPU + +=item devmem + +Device Memory + +=item fin + +Fan In + +=item fout + +Fan Out + +=item vccp + +Voltage ccp + +=item vddg + +Voltage ddg + +=item vddq + +Voltage ddq + +=back + +=item B B|B + +If enabled (the default) various temperatures of the MIC system are reported. + +=item B I + +This option controls which power readings are being reported. Whether matching +power readings are being ignored or I matching power readings are reported +depends on the B setting below. By default I +power readings are reported. + +=item B B|B + +Controls the behavior of the B setting above. If set to B +(the default) only power readings matching a B option are reported +or, if no B option is specified, all power readings are reported. If +set to B, matching power readings are I and all other power readings +are reported. + +Known power names are: + +=over 4 + +=item total0 + +Total power utilization averaged over Time Window 0 (uWatts). + +=item total1 + +Total power utilization averaged over Time Window 0 (uWatts). + +=item inst + +Instantaneous power (uWatts). + +=item imax + +Max instantaneous power (uWatts). + +=item pcie + +PCI-E connector power (uWatts). + +=item c2x3 + +2x3 connector power (uWatts). + +=item c2x4 + +2x4 connector power (uWatts). + +=item vccp + +Core rail (uVolts). + +=item vddg + +Uncore rail (uVolts). + +=item vddq + +Memory subsystem rail (uVolts). + +=back + +=back + =head2 Plugin C The B connects to a Modbus "slave" via Modbus/TCP and reads @@ -2262,7 +2488,7 @@ register values. It supports reading single registers (unsigned 16Ebit values), large integer values (unsigned 32Ebit values) and floating point values (two registers interpreted as IEEE floats in big endian notation). -Synopsis: +B RegisterBase 0 @@ -5539,6 +5765,17 @@ and closed connections. True by default. Statistics about the shared memory log, a memory region to store log messages which is flushed to disk when full. True by default. +=item B B|B + +Statistics about ban operations, such as number of bans added, retired, and +number of objects tested against ban operations. Only available with Varnish +3.x. False by default. + +=item B B|B + +DNS director lookup cache statistics. Only available with Varnish 3.x. False by +default. + =item B B|B Edge Side Includes (ESI) parse statistics. False by default. @@ -5552,10 +5789,27 @@ Statistics about fetches (HTTP requests sent to the backend). False by default. Inserts and look-ups in the crit bit tree based hash. Look-ups are divided into locked and unlocked look-ups. False by default. +=item B B|B + +Statistics on cached objects: number of objects expired, nuked (prematurely +expired), saved, moved, etc. False by default. + +=item B B|B + +Statistics about purge operations, such as number of purges added, retired, and +number of objects tested against purge operations. Only available with Varnish +2.x. False by default. + +=item B B|B + +Client session statistics. Number of past and current sessions, session herd and +linger counters, etc. False by default. + =item B B|B -malloc or umem (umem_alloc(3MALLOC) based) storage statistics. -The umem storage component is Solaris specific. False by default. +malloc or umem (umem_alloc(3MALLOC) based) storage statistics. The umem storage +component is Solaris specific. Only available with Varnish 2.x. False by +default. =item B B|B @@ -5564,13 +5818,28 @@ component is used internally only. False by default. =item B B|B -file (memory mapped file) storage statistics. False by default. +file (memory mapped file) storage statistics. Only available with Varnish 2.x. +False by default. + +=item B B|B + +Current varnish internal state statistics. Number of current sessions, objects +in cache store, open connections to backends (with Varnish 2.x), etc. False by +default. =item B B|B Collects overview counters, such as the number of sessions created, the number of requests and bytes transferred. False by default. +=item B B|B + +Varnish uptime. False by default. + +=item B B|B + +Number of total (available + discarded) VCL (config files). False by default. + =item B B|B Collect statistics about worker threads. False by default. @@ -5615,9 +5884,9 @@ iptables to feed data for the guest IPs into the iptables plugin. The C plugin writes data to I, an open-source metrics storage and graphing project. The plugin connects to I, the data layer -of I, and sends data via the "line based" protocol (per default using -portE2003). The data will be sent in blocks of at most 1428 bytes to -minimize the number of network packets. +of I, via I or I and sends data via the "line based" +protocol (per default using portE2003). The data will be sent in blocks +of at most 1428 bytes to minimize the number of network packets. Synopsis: @@ -5625,6 +5894,8 @@ Synopsis: Host "localhost" Port "2003" + Protocol "udp" + LogSendErrors true Prefix "collectd" @@ -5642,6 +5913,17 @@ Hostname or address to connect to. Defaults to C. Service name or port number to connect to. Defaults to C<2003>. +=item B I + +Protocol to use when connecting to I. Defaults to C. + +=item B B|B + +If set to B (the default), logs errors when sending data to I. +If set to B, it will not log the errors. This is especially useful when +using Protocol UDP since many times we want to use the "fire-and-forget" +approach and logging errors fills syslog with unneeded messages. + =item B I When set, I is added in front of the host name. Dots and whitespace are @@ -5812,7 +6094,7 @@ Synopsis: Protocol UDP StoreRates true AlwaysAppendDS false - Delay 10 + TTLFactor 2.0 Tag "foobar" @@ -5859,6 +6141,15 @@ If set the B, append the name of the I (DS) to the identifies a metric in I. If set to B (the default), this is only done when there is more than one DS. +=item B I + +I events have a I