Deprecate poller.php (#15370)

* Deprecate poller.php

* Apply fixes from StyleCI

* Remove references to poller.php
Leave wrapper...

* fix python style

* update wraper to call lnms device:poll

* Quiet output too

* make pb happy

---------

Co-authored-by: StyleCI Bot <bot@styleci.io>
This commit is contained in:
Tony Murray
2023-10-04 16:32:02 -05:00
committed by GitHub
parent 008efe41cd
commit e0444bffcf
12 changed files with 73 additions and 510 deletions

View File

@@ -490,7 +490,7 @@ COMMUNITY. Use `snmpwalk` instead of `snmpbulkwalk` for v1 devices.
```bash
./discovery.php -h HOSTNAME -d | ./pbin.sh
./poller.php -h HOSTNAME -r -f -d | ./pbin.sh
lnms device:poll HOSTNAME -vv | ./pbin.sh
snmpbulkwalk -OUneb -v2c -c COMMUNITY HOSTNAME . | ./pbin.sh
```

View File

@@ -1,46 +1,32 @@
# poller.php
# lnms device:poll
This document will explain how to use poller.php to debug issues or
This document will explain how to use `lnms device:poll` to debug issues or
manually running to process data.
## Command options
```bash
LibreNMS 2014.master Poller
Description:
Poll data from device(s) as defined by discovery
-h <device id> | <device hostname wildcard> Poll single device
-h odd Poll odd numbered devices (same as -i 2 -n 0)
-h even Poll even numbered devices (same as -i 2 -n 1)
-h all Poll all devices
Usage:
device:poll [options] [--] <device spec>
-i <instances> -n <number> Poll as instance <number> of <instances>
Instances start at 0. 0-3 for -n 4
Arguments:
device spec Device spec to poll: device_id, hostname, wildcard (*), odd, even, all
Debugging and testing options:
-r Do not create or update RRDs
-f Do not insert data into InfluxDB
-d Enable debugging output
-v Enable verbose debugging output
-m Specify module(s) to be run. Comma separate modules, submodules may be added with /
Options:
-m, --modules=MODULES Specify single module to be run. Comma separate modules, submodules may be added with /
-x, --no-data Do not update datastores (RRD, InfluxDB, etc)
-h, --help Display help for the given command. When no command is given display help for the list command
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi|--no-ansi Force (or disable --no-ansi) ANSI output
-n, --no-interaction Do not ask any interactive question
--env[=ENV] The environment the command should run under
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
```
`-h` Use this to specify a device via either id or hostname (including
wildcard using *). You can also specify odd and even. all will run
poller against all devices.
`-i` This can be used to stagger the poller process.
`-r` This option will suppress the creation or update of RRD files.
`-d` Enables debugging output (verbose output but with most sensitive
data masked) so that you can see what is happening during a poller
run. This includes things like rrd updates, SQL queries and response
from snmp.
`-v` Enables verbose debugging output with all data in tact.
`-m` This enables you to specify the module you want to run for poller.
## Poller Wrapper
We have a `poller-wrapper.py` script by [Job
@@ -201,36 +187,36 @@ configured to be ignored by config options.
Here are some examples of running poller from within your install directory.
```bash
./poller.php -h localhost
lnms device:poll localhost
./poller.php -h localhost -m ports
lnms device:poll localhost -m ports
```
## Debugging
To provide debugging output you will need to run the poller process
with the `-d` flag. You can do this either against
with the `-vv` flag. You can do this either against
all modules, single or multiple modules:
All Modules
```bash
./poller.php -h localhost -d
lnms device:poll localhost -vv
```
Single Module
```bash
./poller.php -h localhost -m ports -d
lnms device:poll localhost -m ports -vv
```
Multiple Modules
```bash
./poller.php -h localhost -m ports,entity-physical -d
lnms device:poll localhost -m ports,entity-physical -vv
```
Using `-d` shouldn't output much sensitive information, `-v` will so
Using `-vv` shouldn't output much sensitive information, `-vvv` will so
it is then advisable to sanitise the output before pasting it
somewhere as the debug output will contain snmp details amongst other
items including port descriptions.