X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fcollectd-python.pod;h=0da891f1e47b5aa3dc14eabb7f97fc6b0d7dfc45;hb=b99f2ef5c262080cdd55d4dc056aaf23ba2ff907;hp=06ed11938e00a0cf46bbf949d3d14c3903b292bd;hpb=3709e1d89fba561ae035bd541e354f904213e830;p=collectd.git diff --git a/src/collectd-python.pod b/src/collectd-python.pod index 06ed1193..0da891f1 100644 --- a/src/collectd-python.pod +++ b/src/collectd-python.pod @@ -8,15 +8,15 @@ # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. +=encoding UTF-8 + =head1 NAME collectd-python - Documentation of collectd's C =head1 SYNOPSIS - - Globals true - + LoadPlugin python # ... ModulePath "/path/to/your/python/modules" @@ -45,23 +45,20 @@ The minimum required Python version is I<2.3>. =item B I -Loads the Python plugin I. Unlike most other LoadPlugin lines, this one -should be a block containing the line "Globals true". This will cause collectd -to export the name of all objects in the Python interpreter for all plugins to -see. If you don't do this or your platform does not support it, the embedded -interpreter will start anyway but you won't be able to load certain Python -modules, e.g. "time". +Loads the Python plugin I. =item B I The default encoding for Unicode objects you pass to collectd. If you omit this -option it will default to B on I and B on I. -This is hardcoded in Python and will ignore everything else, including your -locale. +option it will default to B on I. On I it will +always be B, as this function was removed, so this will be silently +ignored. +These defaults are hardcoded in Python and will ignore everything else, +including your locale. =item B I -Appends I to B. You won't be able to import any scripts you +Prepends I to B. You won't be able to import any scripts you wrote unless they are located in one of the directories in this list. Please note that it only has effect on plugins loaded after this option. You can use multiple B lines to add more than one directory. @@ -174,7 +171,7 @@ example. The following types of B are known to collectd =item configuration functions -This type of functions is called during configuration if an appropriate +These are called during configuration if an appropriate B block has been encountered. It is called once for each B block which matches the name of the callback as provided with the B method - see below. @@ -184,14 +181,14 @@ threading functions here! =item init functions -This type of functions is called once after loading the module and before any +These are called once after loading the module and before any calls to the read and write functions. It should be used to initialize the internal state of the plugin (e.Eg. open sockets, ...). This is the earliest point where you may use threads. =item read functions -This type of function is used to collect the actual data. It is called once +These are used to collect the actual data. It is called once per interval (see the B configuration option of collectd). Usually it will call B to dispatch the values to collectd which will pass them on to all registered B. If this function @@ -200,23 +197,23 @@ amount of time until it returns normally again. =item write functions -This type of function is used to write the dispatched values. It is called +These are used to write the dispatched values. It is called once for every value that was dispatched by any plugin. =item flush functions -This type of function is used to flush internal caches of plugins. It is +These are used to flush internal caches of plugins. It is usually triggered by the user only. Any plugin which caches data before writing it to disk should provide this kind of callback function. =item log functions -This type of function is used to pass messages of plugins or the daemon itself +These are used to pass messages of plugins or the daemon itself to the user. =item notification function -This type of function is used to act upon notifications. In general, a +These are used to act upon notifications. In general, a notification is a status message that may be associated with a data instance. Usually, a notification is generated by the daemon if a configured threshold has been exceeded (see the section "THRESHOLD CONFIGURATION" in @@ -534,9 +531,12 @@ your callback, not even None. I is an optional identifier for this callback. The default name is B.I. I is taken from the B<__module__> attribute of your callback function. Every callback needs a unique identifier, so if you -want to register the same callback multiple time in the same module you need to -specify a name here. Otherwise it's save to ignore this parameter I -is the full identifier assigned to this callback. +want to register the same callback multiple times in the same module you need to +specify a name here. Otherwise it's safe to ignore this parameter. + +=item + +I is the full identifier assigned to this callback. =back @@ -557,7 +557,7 @@ receive blocks where your callback identifier matches BI. The callback will be called without arguments. -=item register_read(callback[, interval][, data][, name]) -> identifier +=item register_read(callback[, interval][, data][, name]) -> I This function takes an additional parameter: I. It specifies the time between calls to the callback function. @@ -611,7 +611,33 @@ I is either the string that was returned by the register function or a callback function. The identifier will be constructed in the same way as for the register functions. -=item B(I][, I]) -> None +=item B(I) -> I + +Returns the definition of a dataset specified by I. I is a list +of tuples, each representing one data source. Each tuple has 4 values: + +=over 4 + +=item name + +A string, the name of the data source. + +=item type + +A string that is equal to either of the variables B, +B, B or B. + +=item min + +A float or None, the minimum value. + +=item max + +A float or None, the maximum value. + +=back + +=item B(I[, I][, I]) -> None Flush one or all plugins. I and the specified I are passed on to the registered flush-callbacks. If omitted, the timeout defaults @@ -658,7 +684,7 @@ types used by the read, write and match functions. =item Please feel free to send in new plugins to collectd's mailing list at -EcollectdEatEverplant.orgE for review and, possibly, +EcollectdEatEcollectd.orgE for review and, possibly, inclusion in the main distribution. In the latter case, we will take care of keeping the plugin up to date and adapting it to new versions of collectd. @@ -725,7 +751,7 @@ Sven Trenkel EcollectdEatEsemidefinite.deE. This manpage has been written by Sven Trenkel EcollectdEatEsemidefinite.deE. It is based on the L manual page by -Florian Forster EoctoEatEverplant.orgE and +Florian Forster EoctoEatEcollectd.orgE and Sebastian Harl EshEatEtokkee.orgE. =cut