+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
=head1 NAME
collectd-python - Documentation of collectd's C<python plugin>
Loads the Python plugin I<Plugin>. 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 embeded
-interpreter will start anywa but you won't be able to load certain python
+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".
=item B<Encoding> I<Name>
Appends 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.
+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.
=item B<LogTraces> I<bool>
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
+
+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
+subprocess. This will result in python not using external programs like less
+to display help texts. You can override this behavior with the B<PAGER>
+environment variable, e.g. I<export PAGER=less> before starting collectd.
+Depending on your version of python this might or might not result in an
+B<OSError> exception which can be ignored.
+
=back
=item E<lt>B<Module> I<Name>E<gt> block
=head2 Config
-The Config class is an object which keeps the informations provided in the
+The Config class is an object which keeps the information provided in the
configuration file. The sequence of children keeps one entry for each
configuration option. Each such entry is another Config instance, which
may nest further if nested blocks are used.
Data descriptors defined here:
=over 4
-
+
=item parent
This represents the parent of this node. On the root node
of the config tree it will be None.
-
+
=item key
This is the keyword of this item, i.e. the first word of any given line in the
config file. It will always be a string.
-
+
=item values
This is a tuple (which might be empty) of all value, i.e. words following the
Every item in this tuple will be either a string or a float or a boolean,
depending on the contents of the configuration file.
-
+
=item children
This is a tuple of child nodes. For most nodes this will be empty. If this node
=over 4
=item B<dispatch>([type][, values][, plugin_instance][, type_instance][, plugin][, host][, time][, interval]) -> None.
-
+
Dispatch this instance to the collectd process. The object has members for each
of the possible arguments for this method. For a detailed explanation of these
parameters see the member of the same same.
source. This value has to be a positive integer, so you can't submit more than
one value per second. If this member is set to a non-positive value, the
default value as specified in the config file will be used (default: 10).
-
+
If you submit values more often than the specified interval, the average will
be used. If you submit less values, your graphs will have gaps.
=over 4
=item B<dispatch>([type][, values][, plugin_instance][, type_instance][, plugin][, host][, time][, interval]) -> None. Dispatch a value list.
-
+
Dispatch this instance to the collectd process. The object has members for each
of the possible arguments for this method. For a detailed explanation of these
parameters see the member of the same same.
-
+
If you do not submit a parameter the value saved in its member will be
submitted. If you do provide a parameter it will be used instead, without
altering the member.
=item
This plugin is not compatible with python3. Trying to compile it with python3
-will fail because of the ways string, unicode and bytearray bahavior was
+will fail because of the ways string, unicode and bytearray behavior was
changed.
=item