python plugin¶
| Plugin name | python |
| Type | binding |
| Callbacks | config, flush, init, log, notification, read, shutdown, write |
| Status | supported |
| Since | 4.9 |
| Copyright | 2009 Sven Trenkel |
| License | MIT License |
| Configuration | collectd.conf(5) |
Description¶
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.
Synopsis¶
<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>
Dependencies¶
- Python ≧ 2.3
See also¶
Configuration¶
Configuration options · from collectd.conf(5)
See this section in the full configuration reference
This plugin embeds a Python-interpreter into collectd and provides an interface to collectd's plugin system. See collectd-python(5) for its documentation.