COLLECTD(1)

๐Ÿ’– NAME ๐Ÿ’–

okay bestie, welcome to the collectd manual page (the system calls it COLLECTD(1) but we're literally besties now). so collectd is a system statistics collection daemon โ€” a little background guy that receives stats from your system and makes them available in a bunch of ways. periodt. ๐ŸŽ€


โœจ SYNOPSIS โœจ

collectd [options]

that's it. that's the whole vibe. options go in, daemon goes brrr. ๐Ÿฆ‹


๐ŸŒธ DESCRIPTION ๐ŸŒธ

so collectd is a daemon (a background process, iykyk) that receives system statistics and makes them available in a number of ways. the main daemon itself doesn't have any real functionality apart from loading, querying and submitting to plugins. like, it's the main character but the plugins are the actual stars. for a description of available plugins please see "PLUGINS" below. no cap. ๐Ÿ’…


๐Ÿ”ฅ OPTIONS ๐Ÿ”ฅ

most of collectd's configuration is done using a configfile (yes, the original says "using using" โ€” iconic typo, we keep the facts). see collectd.conf(5) for an in-depth description of all options. ๐Ÿซถ

  • -C <config-file> โ€” specify an alternative config file. this is the place to go when you wish to change collectd's behavior. the path may be relative to the current working directory. slay.
  • -t โ€” test the configuration only. the program immediately exits after parsing the config file. a return code not equal to zero indicates an error. so if it exits with a bad number, something's wrong, bestie. ๐Ÿ˜ญ
  • -T โ€” test the plugin read callbacks only. the program immediately exits after invoking the read callbacks once. a return code not equal to zero indicates an error. same energy as -t but for the plugin read girlies.
  • -P <pid-file> โ€” specify an alternative pid file. this overwrites any settings in the config file. this is thought for init-scripts that require the PID-file in a certain directory to work correctly. for everyday-usage use the PIDFile config-option. don't come for me, that's literally what it says. ๐Ÿ™ˆ
  • -B โ€” if set, collectd will not try to create its base directory. if the base directory does not exist, it will exit rather than trying to create the directory. so it's giving "respect the no" energy. ๐Ÿ’€
  • -f โ€” don't fork to the background. collectd will also not close standard file descriptors, detach from the session nor write a pid file. this is mainly thought for 'supervising' init replacements such as runit. if using upstart or systemd though, starting with version 5.5.0 collectd is able to notify these two init replacements, and does require forking to the background for process supervision. the contrib/ directory has sample upstart and systemd configuration files. the way that's a whole paragraph but every word matters. ๐Ÿงš
  • -h โ€” output usage information and exit. the classic "help me bestie" flag. โญ

๐Ÿ‘‘ PLUGINS ๐Ÿ‘‘

as noted above, the real power of collectd lies within its plugins. a (hopefully complete) list of plugins and short descriptions can be found in the README file that is distributed with the sourcecode. if you're using a package it's a good bet to search somewhere near /usr/share/doc/collectd. iykyk. ๐Ÿ“

there are two big groups of plugins, input and output plugins:

  • Input plugins are queried periodically. they somehow acquire the current value of whatever they where designed to work with and submit these values back to the daemon, i. e. they "dispatch" the values. as an example, the cpu plugin reads the current cpu-counters of time spent in the various modes (user, system, nice, ...) and dispatches these counters to the daemon. main character energy fr fr. ๐Ÿ’œ
  • Output plugins get the dispatched values from the daemon and does something with them. common applications are writing to RRD-files, CSV-files or sending the data over a network link to a remote box. they're the ones who actually post the content. โœจ

of course not all plugins fit neatly into one of the two above categories. the network plugin, for example, is able to send (i. e. "write") and receive (i. e. "dispatch") values. also, it opens a socket upon initialization and dispatches the values when it receives them and isn't triggered at the same time the input plugins are being read. you can think of the network receive part as working asynchronous if it helps. it's giving dual-threat icon. ๐ŸŒˆ

in addition to the above, there are "logging plugins". right now those are the logfile plugin and the syslog plugin. with these plugins collectd can provide information about issues and significant situations to the user. several loglevels let you suppress uninteresting messages. so you can mute the noise, love that for us. ๐Ÿ”ฅ

starting with version 4.3.0 collectd has support for monitoring. this is done by checking thresholds defined by the user. if a value is out of range, a notification will be dispatched to "notification plugins". see collectd.conf(5) for more detailed information about threshold checking. so it's literally watching the numbers and calling out when they're doing too much. ๐Ÿ˜ญ

please note that some plugins, that provide other means of communicating with the daemon, have manpages of their own to describe their functionality in more detail. in particular those are collectd-email(5), collectd-exec(5), collectd-perl(5), collectd-snmp(5), and collectd-unixsock(5). go read those if you want the deep lore. ๐Ÿ“š


๐ŸŽ€ SIGNALS ๐ŸŽ€

collectd accepts the following signals:

  • SIGINT, SIGTERM โ€” these signals cause collectd to shut down all plugins and terminate. it's the "okay bye bestie" signal. ๐Ÿ‘‹
  • SIGUSR1 โ€” this signal causes collectd to signal all plugins to flush data from internal caches. e. g. the rrdtool plugin will write all pending data to the RRD files. this is the same as using the FLUSH -1 command of the unixsock plugin. so it's the "clean up before you go" signal. ๐Ÿงน

๐Ÿฆ‹ SEE ALSO ๐Ÿฆ‹

collectd.conf(5), collectd-email(5), collectd-exec(5), collectd-perl(5), collectd-snmp(5), collectd-unixsock(5), types.db(5), <http://collectd.org/>

like, go click around, it's a whole ecosystem. ๐Ÿ’–


๐ŸŒŸ AUTHOR ๐ŸŒŸ

Florian Forster <octo@collectd.org> โ€” the og. thank you for your service. ๐Ÿซก


and that's the whole manual, bestie. no cap, you're now certified in collectd lore. go collect those stats and slay. ๐Ÿ’…โœจ

version 5.12.0.348.g93f9bdcb โ€” dated 2024-12-18 โ€” this has been your COLLECTD(1) group chat session. mwah. ๐ŸŽ€๐Ÿฆ‹๐Ÿ’–

๐Ÿ“ฆ where this page comes from