Rewrite ups-nut discovery to SnmpQuery:: (#15850)

* modernize and move ups-nut to unix

* fix test data (group and invalid runtime)

* add Battery Temperature to test data

* lnms dev:check style
This commit is contained in:
Peca Nesovanovic
2024-02-26 17:48:40 +01:00
committed by GitHub
parent 851f682155
commit eb6006248f
15 changed files with 385 additions and 907 deletions

View File

@@ -191,7 +191,7 @@ class ModuleTestHelper
$collection_output = preg_replace('/\033\[[\d;]+m/', '', $collection_output);
// extract snmp queries
$snmp_query_regex = '/^SNMP\[\'.*snmp(?:bulk)?(walk|get|getnext)\' .+\'(udp|tcp|tcp6|udp6):(?:\[[0-9a-f:]+\]|[^:]+):[0-9]+\' \'(.+)\'\]$/m';
$snmp_query_regex = '/SNMP\[\'.*snmp(?:bulk)?(walk|get|getnext)\' .+\'(udp|tcp|tcp6|udp6):(?:\[[0-9a-f:]+\]|[^:]+):[0-9]+\' \'(.+)\'\]/m';
preg_match_all($snmp_query_regex, $collection_output, $snmp_matches);
// extract mibs and group with oids