Add sys.argv. Not too many programs consider the possibility that it might not exist...
[collectd.git] / src / collectd-python.pod
index ac679c5..cbfd267 100644 (file)
@@ -1,3 +1,13 @@
+# 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>
@@ -39,8 +49,8 @@ required.
 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>
@@ -54,7 +64,8 @@ locale.
 
 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>
 
@@ -85,7 +96,7 @@ collectd script as well as from a normal python interpreter:
 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,
@@ -95,6 +106,16 @@ exception either.
 
 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
@@ -200,7 +221,7 @@ and collectd:
 
 =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.
@@ -216,17 +237,17 @@ It has no methods beyond the bare minimum and only exists for its data members.
 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
@@ -234,7 +255,7 @@ keyword in any given line in the config file.
 
 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
@@ -318,7 +339,7 @@ Methods defined here:
 =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.
@@ -346,7 +367,7 @@ The interval is the timespan in seconds between two submits for the same data
 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.
 
@@ -394,11 +415,11 @@ Methods defined here:
 =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.
@@ -620,7 +641,7 @@ dispatched by the python plugin after upgrades.
 =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