. * * @link http://librenms.org * @copyright 2018 Tony Murray * @author Tony Murray */ namespace LibreNMS\OS; use App\Models\Device; use LibreNMS\Device\Processor; use LibreNMS\Interfaces\Discovery\ProcessorDiscovery; use LibreNMS\OS; class Dlinkap extends OS implements ProcessorDiscovery { public function discoverOS(Device $device): void { $firmware_oid = $device->sysObjectID . '.5.1.1.0'; $hardware_oid = $device->sysObjectID . '.5.1.5.0'; $device->version = snmp_get($device, $firmware_oid, '-Oqv') ?: null; $device->hardware = trim($device->sysDescr . ' ' . snmp_get($device, $hardware_oid, '-Oqv')); } /** * Discover processors. * Returns an array of LibreNMS\Device\Processor objects that have been discovered * * @return array Processors */ public function discoverProcessors() { return [ Processor::discover( 'dlinkap-cpu', $this->getDeviceId(), $this->getDeviceArray()['sysObjectID'] . '.5.1.3.0', // different OID for each model 0, 'Processor', 100 ), ]; } }