1 collectd on Debian
2 ==================
4 General notes:
5 --------------
7 - Some plugins require additional libraries. To prevent you from having to
8 install dependencies that you don't actually need those libraries are
9 recommendations rather than dependencies. See README.Debian.plugins in the
10 "collectd" package for details.
12 Configuring collectd:
13 ---------------------
15 - See collectd.conf(5) for details about configuring collectd.
17 Access the collected data:
18 --------------------------
20 collectd is able to write data to CSV (comma separated list) and RRD (round
21 robin database - see http://oss.oetiker.ch/rrdtool/) files. However it does
22 not create graphs from these files. This package contains two sample scripts
23 in /usr/share/doc/collectd/examples/ which can be used for this purpose. They
24 are meant to be a starting point for your own experiments - more sophisticated
25 solutions are welcome.
27 - collectd2html.pl: This script by Vincent Stehlé will search for RRD files in
28 "/var/lib/collectd/" and generate a static HTML file and a directory
29 containing several PNG files which are graphs of the RRD files found.
31 - collection.cgi: Sample CGI script that creates graphs on the fly. The Perl
32 modules "RRDs" (package librrds-perl), "URI:Escape" (package liburi-perl),
33 "HTML::Entities" (package libhtml-parser-perl) and a CGI capable web server
34 (e.g. apache2 or boa) are required for this script to run. Simply install
35 the (gunzip'ed) script to a place where the webserver will treat it as a CGI
36 script (/usr/lib/cgi-bin/ by default) and visit that page in a browser
37 (http://localhost/cgi-bin/collection.cgi by default). Please refer to your
38 webserver's documentation for more details.
40 Starting with version 4, collection.cgi requires a small config file, which
41 is installed to /etc/collectd/collection.conf. You should not need to change
42 anything there.
44 Building your own plugins:
45 --------------------------
47 - Originally, plugins for collectd had to be written in C and linked as shared
48 objects. Starting with version 4.0.0, it is also possible to use plugins
49 written in the scripting language Perl or implemented as separate processes.
50 See collectd-perl(5) and collectd-exec(5) for details.
52 - If you want to contribute plugins to the official distribution you should
53 read http://collectd.org/dev-info.shtml.
55 - If you want to build C plugins for your personal use only simply install the
56 collectd-dev package and use /usr/share/doc/collectd-dev/examples/myplugin.c
57 as a starting point (Note: This is already a working example, though it does
58 not collect any useful data).
60 The resulting file can be compiled as follows:
62 gcc -shared -fPIC -o myplugin.so myplugin.c
64 Copy myplugin.so to /usr/lib/collectd and add the following line to your
65 collectd config file:
67 LoadPlugin myplugin
69 Restart collectd and you're done.
71 - The collectd-dev package also provides an example Perl plugin that can be
72 used as a starting point for your own development. It can be found in
73 /usr/share/doc/collectd-dev/examples/MyPlugin.pm (Note: This is already a
74 working example, though it does not collect any useful data).
76 To enable the plugin, copy it to a place where Perl can find it (i.e. a
77 subdirectory named "Collectd/Plugin" of a directory listed in @INC) and add
78 the following line to the perl plugin section in your config file:
80 LoadPlugin "Collectd::Plugin::MyPlugin"
82 or
84 BaseName "Collectd::Plugin"
85 LoadPlugin MyPlugin
87 Restart collectd and you're done.
89 Examples:
90 ---------
92 - SpamAssassin/: This directory contains a SpamAssassin plugin which passes
93 statistics to collectd using the email plugin. See the embedded POD
94 documentation for information about setup and configuration: perldoc
95 Collectd.pm.
97 - iptables/: This directory contains a script which will setup iptables to do
98 global logging of all traffic going in and out of an interface. This
99 information can then be collected by collectd's iptables plugin.
101 - cussh.pl: "Collectd Unix Socket SHell" is a small, interactive front-end for
102 the unixsock plugin. See the embedded POD documentation for details: perldoc
103 cussh.pl.
105 - exec-munin.px: Script to be used with the exec-plugin (see collectd-exec(5)
106 for details) which executes munin plugins, parses the output and translates
107 it to a format the exec-plugin understands. The features are limited -
108 changing the munin plugins to use the output format understood by the
109 exec-plugin is recommended. See the embedded POD documentation for more
110 details: perldoc exec-munin.px
112 - exec-smartctl: Sample script for the exec plugin. Please refer to the
113 documentation in the file - you will have to adapt it to your needs anyway.
115 - network-proxy.py: A simple unicast proxy for collectd traffic.
117 - snmp-data.conf: Sample configuration for the SNMP plugin. This config
118 includes a few standard <Data ..> definitions that you can include in your
119 own config using the `Include' statement (available since version 4.2.0).
120 The config includes some data that is defined in the IF-MIB, e. g. octet or
121 packet counters, UPS-MIB and whatever people have send in. If you have some
122 more definitions please send them in, so others can profit from it.
124 Additional helper scripts:
125 --------------------------
127 - add_rra.sh: Before version 3.9.0 collectd used to create a different set of
128 RRAs. The most detailed of these old RRAs had a one minute resolution. This
129 script can be used to add three more RRAs: minimum, maximum and average with
130 a ten second resolution and 2200 rows (~6 hours). This will make hourly
131 statistics much more interesting. Please note that no sanity-checking
132 whatsoever is performed. You can seriously screw up your RRD files if you
133 don't know what you're doing.