Rename NetSnmp to SnmpQuery (#13344)

* Rename NetSnmp to SnmpQuery
Always resolve a new instance.  It was not expected to be a singleton, set options persisted.
This means numeric() works properly now

* fix snmpfetch call and style

* Ability to set device from device array
This commit is contained in:
Tony Murray
2021-10-07 17:03:53 -05:00
committed by GitHub
parent 0d9cd86350
commit 4e94c1e0a1
7 changed files with 48 additions and 20 deletions

View File

@@ -32,7 +32,7 @@ use LibreNMS\Data\Source\Fping;
use LibreNMS\Data\Source\FpingResponse;
use LibreNMS\RRD\RrdDefinition;
use Log;
use NetSnmp;
use SnmpQuery;
use Symfony\Component\Process\Process;
class ConnectivityHelper
@@ -133,7 +133,7 @@ class ConnectivityHelper
public function isSNMPable(): bool
{
$response = NetSnmp::device($this->device)->get('SNMPv2-MIB::sysObjectID.0');
$response = SnmpQuery::device($this->device)->get('SNMPv2-MIB::sysObjectID.0');
return $response->getExitCode() === 0 || $response->isValid();
}