mod-collectd’s documentation¶
Installation¶
Download¶
- The Collectd module is available here:
Installation¶
Copy the collectd module folder from the git repository to your shinken/modules directory (set by modules_dir in shinken.cfg)
CLI installation¶
TODO
Manual installation¶
For example, if your modules dir is ‘/var/lib/shinken/modules’:
cd /var/lib/shinken/modules
wget https://github.com/shinken-monitoring/mod-collectd/archive/master.zip -O mod-collectd.zip
unzip mod-collectd.zip
Configuration¶
Shinken Collectd module¶
Collectd module declaration¶
Add and modify the following configuration in collectd.cfg
define module {
module_name Collectd
module_type collectd
# Specify exact host (optional)
host 0.0.0.0
port 25826
multicast False
# Select which collectd plugin you want to group
# Example :
# grouped_collectd_plugins cpu, df
# This will group all 'cpu' plugin instances in one service called 'cpu' with all perf datas : cpu-0-wait, cpu-1-wait, cpu-0-idle, cpu-1-idle, ....
# AND yhis will group all 'df' plugin instances in one service called 'df' with all perf datas : df-complex-root-free, ....
# If grouped_collectd_plugins is empty
# This will not group plugin instances and you will have this following services : cpu-0, cpu-1, df-root, ...
#
# grouped_collectd_plugins
}
Important
You have to be sure that the collectd.cfg will be loaded by Shinken (watch in your shinken.cfg)
Parameters details¶
host: | Bind address |
---|---|
port: | Bind port. Default: 25826 |
multiscast: | ?????. Default: False |
grouped_collectd_plugins: | |
List of collectd plugins where plugin instances will be group by plugin. Default: empty. Example: cpu,df,disk,interface |
Collectd agent configuration¶
You have to configure your Collectd agents for they send datas to Shinken. In the collectd.conf file, you have to have:
LoadPlugin network
<Plugin network>
Server "192.168.2.16" "25826"
</Plugin>
Where 192.168.2.16 is the Receiver/Arbiter IP.
Collectd Developer Reference¶
Collectd Plugin for Receiver or arbiter
-
class
module.module.
Collectd_arbiter
(modconf, host, port, multicast, grouped_collectd_plugins=None, use_decicated_reader_thread=False)[source]¶ Bases:
BaseModule
Main class for this collecitd module
-
class
module.module.
Element
(host_name, sdesc, interval, last_sent=None)[source]¶ Bases:
object
Element store service name and all perfdatas before send it in a external command
-
add_perf_data
(mname, mvalues, mtime)[source]¶ Add perf datas to this element. :param mname: The metric name. :param mvalues: The metric read values. :param mtime: The “epoch” time when the values were read.
-
get_command
()[source]¶ Look if this element has data to be sent to Shinken. :return
- None if element has not all its perf data refreshed since last sent..
- The command to be sent otherwise.
-
last_full_update
¶ Returns: The last “full” update time of this element. i.e. the metric mininum last update own time.
-
send_ready
¶ Returns: True if this element is ready to have its perfdata sent. False otherwise.
-