lnms snmp:fetch command and new SNMP code (#13303)

* SNMP WIP

* cleanup, more types

* Include my snmp:fetch command

* Fix Facade name conflict

* Command WIP
remove mib

* Ignore exit code
cleanups

* Doc blocks and style fixes

* forgot to use parseOid

* Hopefully final fixes

* missed on (:

* small changes
deviates from existing code, hopefully doesn't re-add too many corner cases.

* add some simple tests, will make it easier to add more in the future when we find corner cases.

* test numeric

* API refinements, try to avoid setting textual net-snmp options directly

* change numeric to a toggle makes for nicer usage

* make ci happy

* Some errors happen only in stderr, pass that to SnmpResponse for parsing.
Add error message access

* More consistent naming
This commit is contained in:
Tony Murray
2021-10-01 18:58:12 -05:00
committed by GitHub
parent d63656c1e0
commit a828bb00c3
7 changed files with 804 additions and 1 deletions

View File

@@ -102,6 +102,22 @@ return [
'compat' => '[deprecated] Mimic the behaviour of gen_smokeping.php',
],
],
'snmp:fetch' => [
'description' => 'Run snmp query against a device',
'arguments' => [
'device spec' => 'Device to query: device_id or hostname/ip',
'oid' => 'SNMP OID to fetch. Should be either MIB::oid or a numeric oid',
],
'failed' => 'SNMP command failed!',
'oid' => 'OID',
'options' => [
'type' => 'The type of snmp query to perform :types',
'output' => 'Specify the output format :formats',
'numeric' => 'Numeric OIDs',
],
'not_found' => 'Device not found',
'value' => 'Value',
],
'translation:generate' => [
'description' => 'Generate updated json language files for use in the web frontend',
],