SnmpQuery numeric accept a boolean (#14565)

This commit is contained in:
Tony Murray
2022-11-02 18:50:46 -05:00
committed by GitHub
parent bd4c2d70fb
commit 0c365d08e3
4 changed files with 9 additions and 11 deletions

View File

@@ -65,13 +65,9 @@ class SnmpFetch extends LnmsCommand
$output = $this->option('output')
?: ($type == 'walk' ? 'table' : 'value');
$query = SnmpQuery::make();
if ($this->option('numeric')) {
$query->numeric();
}
/** @var \LibreNMS\Data\Source\SnmpResponse $res */
$res = $query->$type($this->argument('oid'));
$res = SnmpQuery::numeric($this->option('numeric'))
->$type($this->argument('oid'));
if (! $res->isValid()) {
$this->warn(trans('commands.snmp:fetch.failed'));