Plugin Python
Name: | Python plugin |
---|---|
Type: | binding |
Callbacks: | config, flush, init, log, notification, read, shutdown, write |
Status: | supported |
FirstVersion: | 4.9 |
Copyright: | 2009 Sven Trenkel |
License: | MIT License |
Manpage: | collectd-python(5) |
See also: | List of Plugins |
The Python plugin embeds a Python interpreter into collectd and exposes the application programming interface (API) to Python-scripts. This allows to write own plugins in the popular scripting language, which are then loaded and executed by the daemon without the need to start a new process and interpreter every few seconds. Python-modules written for the Python plugin are therefore more powerful and efficient than scripts executed by the Exec plugin.
This plugin is a generic plugin, i.e. it cannot work without configuration, because there is no reasonable default behavior. Please read the Plugin python section of the collectd.conf(5) manual page for an in-depth description of the plugin's configuration. Most aspects of the Python plugin are documented in the collectd-python(5) manual page.
<LoadPlugin python>
Globals true
</LoadPlugin>
# ...
<Plugin python>
ModulePath "/path/to/your/python/modules"
LogTraces true
Interactive true
Import "spam"
<Module spam>
spam "wonderful" "lovely"
</Module>
</Plugin>
- Python ≧ 2.3