Skip to content
Florian Forster edited this page Nov 20, 2023 · 1 revision
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

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

Clone this wiki locally