mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Improve SnmpResponse value() (#14605)
* Improve SnmpResponse value Can now return a specific oid or the first non-empty oid in a list. Cache values() call on object to avoid repeated parsing Improved types * fix style * extract getOidParts to fix errors from different parts of the code parsing differently * new object to deal with cache * More tests * whitespace * style
This commit is contained in:
@@ -236,7 +236,7 @@ class Core implements Module
|
||||
->options($value['options'] ?? null)
|
||||
->mibDir($value['mib_dir'] ?? $mibdir)
|
||||
->walk(isset($value['mib']) ? "{$value['mib']}::{$value['oid']}" : $value['oid'])
|
||||
->raw();
|
||||
->raw;
|
||||
if (Compare::values($walk_value, $value['value'], $value['op'] ?? 'contains') == $check) {
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user