2018-09-06 17:05:44 -05:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Pbn.php
|
|
|
|
*
|
|
|
|
* -Description-
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2021-02-09 00:29:04 +01:00
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2018-09-06 17:05:44 -05:00
|
|
|
*
|
2021-02-09 00:29:04 +01:00
|
|
|
* @link https://www.librenms.org
|
2021-09-10 20:09:53 +02:00
|
|
|
*
|
2018-09-06 17:05:44 -05:00
|
|
|
* @copyright 2018 Tony Murray
|
|
|
|
* @author Tony Murray <murraytony@gmail.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace LibreNMS\OS;
|
|
|
|
|
|
|
|
use LibreNMS\Device\Processor;
|
|
|
|
use LibreNMS\Interfaces\Discovery\ProcessorDiscovery;
|
|
|
|
use LibreNMS\OS;
|
|
|
|
|
|
|
|
class Pbn extends OS implements ProcessorDiscovery
|
|
|
|
{
|
2022-01-30 16:28:18 -06:00
|
|
|
public function __construct(&$device)
|
|
|
|
{
|
|
|
|
parent::__construct($device);
|
|
|
|
|
|
|
|
preg_match('/^.* Build (?<build>\d+)/', $this->getDevice()->version, $version);
|
|
|
|
if ($version['build'] <= 16607) { // Buggy version :-(
|
|
|
|
$this->stpTimeFactor = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-09-06 17:05:44 -05:00
|
|
|
/**
|
|
|
|
* 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
|
|
|
|
),
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|