X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fcollectd-python.pod;h=77f3497b6b924f2515f3896ff0584aec39b2806c;hb=bf8a30d732662ea480e7401768e1db92d03f1a1c;hp=b382424b7b0392180219156d18de144f58043b60;hpb=b61a03b05c1f4040a6599334b65141aa3bd134f5;p=collectd.git diff --git a/src/collectd-python.pod b/src/collectd-python.pod index b382424b..77f3497b 100644 --- a/src/collectd-python.pod +++ b/src/collectd-python.pod @@ -50,13 +50,15 @@ 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. @@ -85,12 +87,12 @@ collectd script as well as from a normal Python interpreter: =over 4 -=item +=item * B<1.> collectd will try to import the B module to give you a decent way of entering your commands. The daemonized collectd won't do that. -=item +=item * B<2.> collectd will block I. Pressing I will usually cause collectd to shut down. This would be problematic in an interactive session, @@ -100,7 +102,7 @@ exception either. To quit collectd send I (press I at the beginning of a new line). -=item +=item * B<3.> collectd handles I. This means that Python won't be able to determine the return code of spawned processes with system(), popen() and @@ -513,18 +515,18 @@ different events. With one exception all of them are called as shown above. =over 4 -=item +=item * I is a callable object that will be called every time the event is triggered. -=item +=item * I is an optional object that will be passed back to the callback function every time it is called. If you omit this parameter no object is passed back to your callback, not even None. -=item +=item * I is an optional identifier for this callback. The default name is B.I. I is taken from the B<__module__> attribute of @@ -532,7 +534,7 @@ your callback function. Every callback needs a unique identifier, so if you 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 +=item * I is the full identifier assigned to this callback. @@ -555,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. @@ -609,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 None Flush one or all plugins. I and the specified I are passed on to the registered flush-callbacks. If omitted, the timeout defaults @@ -643,8 +671,8 @@ A very simple write function might look like: To register those functions with collectd: - collectd.register_read(read); - collectd.register_write(write); + collectd.register_read(read) + collectd.register_write(write) See the section L<"CLASSES"> above for a complete documentation of the data types used by the read, write and match functions. @@ -653,10 +681,10 @@ types used by the read, write and match functions. =over 4 -=item +=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. @@ -669,7 +697,7 @@ L. =over 4 -=item +=item * collectd is heavily multi-threaded. Each collectd thread accessing the Python plugin will be mapped to a Python interpreter thread. Any such thread will be @@ -679,13 +707,13 @@ Hence, any plugin has to be thread-safe if it provides several entry points from collectd (i.Ee. if it registers more than one callback or if a registered callback may be called more than once in parallel). -=item +=item * The Python thread module is initialized just before calling the init callbacks. This means you must not use Python's threading module prior to this point. This includes all config and possibly other callback as well. -=item +=item * The python plugin exports the internal API of collectd which is considered unstable and subject to change at any time. We try hard to not break backwards @@ -699,7 +727,7 @@ dispatched by the python plugin after upgrades. =over 4 -=item +=item * Not all aspects of the collectd API are accessible from Python. This includes but is not limited to filters and data sets. @@ -723,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