index b382424b7b0392180219156d18de144f58043b60..773a6cd4b7919b1d950794c63b49dc401e43a4c1 100644 (file)
--- a/src/collectd-python.pod
+++ b/src/collectd-python.pod
=item B<Encoding> I<Name>
The default encoding for Unicode objects you pass to collectd. If you omit this
-option it will default to B<ascii> on I<Python 2> and B<utf-8> on I<Python 3>.
-This is hardcoded in Python and will ignore everything else, including your
-locale.
+option it will default to B<ascii> on I<Python 2>. On I<Python 3> it will
+always be B<utf-8>, 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<ModulePath> I<Name>
-Appends I<Name> to B<sys.path>. You won't be able to import any scripts you
+Prepends I<Name> to B<sys.path>. 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<ModulePath> lines to add more than one directory.
=over 4
-=item
+=item *
B<1.> collectd will try to import the B<readline> 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<SIGINT>. Pressing I<Ctrl+C> will usually cause
collectd to shut down. This would be problematic in an interactive session,
To quit collectd send I<EOF> (press I<Ctrl+D> at the beginning of a new line).
-=item
+=item *
B<3.> collectd handles I<SIGCHLD>. This means that Python won't be able to
determine the return code of spawned processes with system(), popen() and
=over 4
-=item
+=item *
I<callback> is a callable object that will be called every time the event is
triggered.
-=item
+=item *
I<data> 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<name> is an optional identifier for this callback. The default name is
B<python>.I<module>. I<module> is taken from the B<__module__> attribute of
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<identifier> is the full identifier assigned to this callback.
The callback will be called without arguments.
-=item register_read(callback[, interval][, data][, name]) -> identifier
+=item register_read(callback[, interval][, data][, name]) -> I<identifier>
This function takes an additional parameter: I<interval>. It specifies the
time between calls to the callback function.
or a callback function. The identifier will be constructed in the same way as
for the register functions.
-=item B<flush>(I<plugin[, I<timeout>][, I<identifier>]) -> None
+=item B<get_dataset>(I<name>) -> I<definition>
+
+Returns the definition of a dataset specified by I<name>. I<definition> 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<DS_TYPE_COUNTER>,
+B<DS_TYPE_GAUGE>, B<DS_TYPE_DERIVE> or B<DS_TYPE_ABSOLUTE>.
+
+=item min
+
+A float or None, the minimum value.
+
+=item max
+
+A float or None, the maximum value.
+
+=back
+
+=item B<flush>(I<plugin[, timeout][, identifier]) -> None
Flush one or all plugins. I<timeout> and the specified I<identifiers> are
passed on to the registered flush-callbacks. If omitted, the timeout defaults
=over 4
-=item
+=item *
Please feel free to send in new plugins to collectd's mailing list at
-E<lt>collectdE<nbsp>atE<nbsp>verplant.orgE<gt> for review and, possibly,
+E<lt>collectdE<nbsp>atE<nbsp>collectd.orgE<gt> 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.
=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
from collectd (i.E<nbsp>e. 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
=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.
This manpage has been written by Sven Trenkel
E<lt>collectdE<nbsp>atE<nbsp>semidefinite.deE<gt>.
It is based on the L<collectd-perl(5)> manual page by
-Florian Forster E<lt>octoE<nbsp>atE<nbsp>verplant.orgE<gt> and
+Florian Forster E<lt>octoE<nbsp>atE<nbsp>collectd.orgE<gt> and
Sebastian Harl E<lt>shE<nbsp>atE<nbsp>tokkee.orgE<gt>.
=cut