mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Major Processors rewrite (#8066)
* Extract DiscoveryItem and move some things to better places. Extract model class Fix up model construction. I have problem with construction... Makeshift model working. Switch constructor to factory. discover() and create() Support legacy discovery. Remove uneeded custom pollers Remove netonix custom detection as we try ucd on all os now. Add a few yaml procs. Fix a couple things. More processor discovery conversions Move Calix e7 to standard hrProcessorLoad, but it doesn't fully implement the HR-MIB, move things around to make it work. Add a few yaml procs. Fix a couple things. Correct some stupid mib stuff. Move more, drop php 5.3 Add netscaler which uses string indexes. Port fiberhome to yaml and use skip_values More conversions. BroadcomProcessorUsage Trait Serveriron and Ironware share some mibs. Create a common abstract os for them. Add yaml support for mib specification in each data entry Make legacy discover_processor() set 0 for hrDeviceIndex Untangle Dell switch OS processors Use use shared OS for groups if they don't have a specific group. fix silly mib mistake Make index optional Move HR and UCD to Traits and out of Processor. * forgot to update the fortiswitch index * Make sgos and avaya-ers match the old index. * fix comware test data * fix merge errors * fix dsm and remove pointless empty modules * file not found exception is in the wrong place. * Updated processor development docs
This commit is contained in:
32
LibreNMS/Interfaces/Discovery/DiscoveryItem.php
Normal file
32
LibreNMS/Interfaces/Discovery/DiscoveryItem.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by IntelliJ IDEA.
|
||||
* User: murrant
|
||||
* Date: 12/6/17
|
||||
* Time: 8:48 AM
|
||||
*/
|
||||
|
||||
namespace LibreNMS\Interfaces\Discovery;
|
||||
|
||||
use LibreNMS\OS;
|
||||
|
||||
interface DiscoveryItem
|
||||
{
|
||||
/**
|
||||
* Does this item represent an actual item or did it fail validation
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isValid();
|
||||
|
||||
/**
|
||||
* Generate an instance of this class from yaml data.
|
||||
* The data is processed and any snmp data is filled in
|
||||
*
|
||||
* @param OS $os
|
||||
* @param int $index the index of the current entry
|
||||
* @param array $data
|
||||
* @return static
|
||||
*/
|
||||
public static function fromYaml(OS $os, $index, array $data);
|
||||
}
|
@@ -29,5 +29,5 @@ use LibreNMS\OS;
|
||||
|
||||
interface DiscoveryModule
|
||||
{
|
||||
public static function discover(OS $os);
|
||||
public static function runDiscovery(OS $os);
|
||||
}
|
||||
|
37
LibreNMS/Interfaces/Discovery/ProcessorDiscovery.php
Normal file
37
LibreNMS/Interfaces/Discovery/ProcessorDiscovery.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/**
|
||||
* ProcessorDiscovery.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
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @package LibreNMS
|
||||
* @link http://librenms.org
|
||||
* @copyright 2017 Tony Murray
|
||||
* @author Tony Murray <murraytony@gmail.com>
|
||||
*/
|
||||
|
||||
namespace LibreNMS\Interfaces\Discovery;
|
||||
|
||||
interface ProcessorDiscovery
|
||||
{
|
||||
/**
|
||||
* Discover processors.
|
||||
* Returns an array of LibreNMS\Device\Processor objects that have been discovered
|
||||
*
|
||||
* @return array Processors
|
||||
*/
|
||||
public function discoverProcessors();
|
||||
}
|
37
LibreNMS/Interfaces/Polling/ProcessorPolling.php
Normal file
37
LibreNMS/Interfaces/Polling/ProcessorPolling.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/**
|
||||
* ProcessorPolling.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
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @package LibreNMS
|
||||
* @link http://librenms.org
|
||||
* @copyright 2017 Tony Murray
|
||||
* @author Tony Murray <murraytony@gmail.com>
|
||||
*/
|
||||
|
||||
namespace LibreNMS\Interfaces\Polling;
|
||||
|
||||
interface ProcessorPolling
|
||||
{
|
||||
/**
|
||||
* Poll processor data. This can be implemented if custom polling is needed.
|
||||
*
|
||||
* @param array $processors Array of processor entries from the database that need to be polled
|
||||
* @return array of polled data
|
||||
*/
|
||||
public function pollProcessors(array $processors);
|
||||
}
|
Reference in New Issue
Block a user