Add module support for wrapper script calls (#14055)

* Add module support for wrapper script calls

The scripts poller.php and discovery.php offer a module
option (-m), which may be used to specify specific modules
for polling/discovery, possibly for special (and then faster) testing
or for example rediscovering the fdb table (on all hosts).

Until now, this was not possible with the python wrapper scripts.
Now they support a '-m' option, where comma separated module names
may be passed. This will currently only work with poller and discovery, though.

* Replace single quotation signs with double ones (empty strings only)

* Fix more code lines (quotation signs, indentation)

Also 'reduced' if-else-clause size at end of LibreNMS/wrapper.py
(do not call method at each branch, instead prepare a value for modules)

* Add commas after last parameter of dict+methode

Also an additional comment sign before #

* Fix two leftover single quot. signs …

* doc: Add documentation for module support
This commit is contained in:
Marek Wobst
2023-07-20 06:09:57 +02:00
committed by GitHub
parent 54a38dd4cd
commit 0e952b9c98
4 changed files with 47 additions and 1 deletions

View File

@@ -48,6 +48,10 @@ If you need to debug the output of discovery-wrapper.py then you can
add `-d` to the end of the command - it is NOT recommended to do this
in cron.
You also may use `-m` to pass a list of comma-separated modules.
Please refer to [Command options](#command-options) of discovery.php.
Example: `/opt/librenms/discovery-wrapper.py 1 -m bgp-peers`
If you want to switch back to discovery.php then you can replace:
`33 */6 * * * librenms /opt/librenms/discovery-wrapper.py 1 >> /dev/null 2>&1`