. * * @link https://www.librenms.org * * @copyright 2018 Tony Murray * @author Tony Murray */ namespace LibreNMS\OS; use LibreNMS\Device\Processor; use LibreNMS\Interfaces\Discovery\ProcessorDiscovery; use LibreNMS\OS; class Pbn extends OS implements ProcessorDiscovery { public function __construct(&$device) { parent::__construct($device); preg_match('/^.* Build (?\d+)/', $this->getDevice()->version, $version); if ($version['build'] <= 16607) { // Buggy version :-( $this->stpTimeFactor = 1; } } /** * Discover processors. * Returns an array of LibreNMS\Device\Processor objects that have been discovered * * @return array Processors */ public function discoverProcessors() { return [ Processor::discover( 'pbn-cpu', $this->getDeviceId(), '.1.3.6.1.4.1.11606.10.9.109.1.1.1.1.5.1', // NMS-PROCESS-MIB::nmspmCPUTotal5min 0 ), ]; } }