From charlesreid1

Line 13: Line 13:
<pre>
<pre>
apt-get install collectd
apt-get install collectd
</pre>
To install plugins:
<pre>
apt-get install collectd-utils
</pre>
</pre>



Revision as of 05:34, 3 February 2018

Collectd is similar to Netdata in that it is a logging program that collects system metrics. It is implemented as a unix-style daemon, with lots of plugins.

Linode uses collectd to provide users with system status dashboards.

Link: https://collectd.org/

installing

debian

install with aptitude:

apt-get install collectd

To install plugins:

apt-get install collectd-utils

mac

install with homebrew:

brew install collectd

openwrt

(no opkg available...)

config and usage

As you can deduce from the name, collectd is a daemon, so it runs as a background process.

The way you use it is to edit the configuration file, set up any plugins, and then let the daemon service run.

config

Link: https://collectd.org/wiki/index.php/First_steps#Configuration

Edit the config file at /etc/collectd.conf or /etc/collectd/collectd.conf

Each plugin (see below) has a LoadPlugin line in the configuration. Plugins are bits of code that tell collectd how to collect various metrics.

Most plugins are commented out to keep things lean. The number of comment characters is significant.

  • Two comment characters ## mean the plugin has not been built
  • One comment character means the plugin has been built
  • Default enabled plugins: cpu, interface, load, memory

The config file sets all kinds of parameters. The code for the plugin will parse these parameters when they run, and use those to collect data and send it back to collectd.

plugins

when talking about plugins, we must distinguish between two kinds of plugins: collect plugins, and write plugins.

collect plugins provide collectd with a way to ask a particular server or piece of software for statistics. This type of plugin allows collectd to monitor that software.

write plugins provide collectd with a way to write its data to a particular piece of software. This type of plugin allows collectd to use a particular piece of software as a backend.

as an example:

write plugins

mongodb

The write plugin for mongodb allows collectd to write to a mongodb database.

Link: https://collectd.org/wiki/index.php/Plugin:Write_MongoDB

graphite

https://collectd.org/wiki/index.php/Plugin:Write_Graphite

prometheus

https://collectd.org/wiki/index.php/Plugin:Write_Prometheus


collect plugins

Full table of plugins: https://collectd.org/wiki/index.php/Table_of_Plugins

Custom plugins: http://docs.rightscale.com/cm/rs101/create_custom_collectd_plug-ins_for_linux.html

flags