mirror of
https://github.com/librenms/librenms.git
synced 2024-09-21 10:28:13 +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:
parent
d9e366398e
commit
11147d3bbf
@ -42,7 +42,7 @@ after_failure:
|
||||
script:
|
||||
- php scripts/pre-commit.php -l
|
||||
- php scripts/pre-commit.php -s
|
||||
- SNMPSIM=1 DBTEST=1 vendor/bin/phpunit --stop-on-failure
|
||||
- php scripts/pre-commit.php -u --db --snmpsim --fail-fast
|
||||
- bash -n daily.sh
|
||||
- pylint -E poller-wrapper.py discovery-wrapper.py
|
||||
- bash scripts/deploy-docs.sh
|
||||
|
311
LibreNMS/Device/Processor.php
Normal file
311
LibreNMS/Device/Processor.php
Normal file
@ -0,0 +1,311 @@
|
||||
<?php
|
||||
/**
|
||||
* Processor.php
|
||||
*
|
||||
* Processor Module
|
||||
*
|
||||
* 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\Device;
|
||||
|
||||
use LibreNMS\Config;
|
||||
use LibreNMS\Interfaces\Discovery\DiscoveryItem;
|
||||
use LibreNMS\Interfaces\Discovery\DiscoveryModule;
|
||||
use LibreNMS\Interfaces\Discovery\ProcessorDiscovery;
|
||||
use LibreNMS\Interfaces\Polling\PollerModule;
|
||||
use LibreNMS\Interfaces\Polling\ProcessorPolling;
|
||||
use LibreNMS\Model;
|
||||
use LibreNMS\OS;
|
||||
use LibreNMS\RRD\RrdDefinition;
|
||||
|
||||
class Processor extends Model implements DiscoveryModule, PollerModule, DiscoveryItem
|
||||
{
|
||||
protected static $table = 'processors';
|
||||
protected static $primaryKey = 'processor_id';
|
||||
|
||||
private $valid = true;
|
||||
|
||||
public $processor_id;
|
||||
public $device_id;
|
||||
public $processor_type;
|
||||
public $processor_usage;
|
||||
public $processor_oid;
|
||||
public $processor_index;
|
||||
public $processor_descr;
|
||||
public $processor_precision;
|
||||
public $entPhysicalIndex;
|
||||
public $hrDeviceIndex;
|
||||
public $processor_perc_warn = 75;
|
||||
|
||||
/**
|
||||
* Processor constructor.
|
||||
* @param string $type
|
||||
* @param int $device_id
|
||||
* @param string $oid
|
||||
* @param int $index
|
||||
* @param string $description
|
||||
* @param int $precision The returned value will be divided by this number (should be factor of 10) If negative this oid returns idle cpu
|
||||
* @param int $current_usage
|
||||
* @param int $warn_percent
|
||||
* @param int $entPhysicalIndex
|
||||
* @param int $hrDeviceIndex
|
||||
* @return Processor
|
||||
*/
|
||||
public static function discover(
|
||||
$type,
|
||||
$device_id,
|
||||
$oid,
|
||||
$index,
|
||||
$description = 'Processor',
|
||||
$precision = 1,
|
||||
$current_usage = null,
|
||||
$warn_percent = 75,
|
||||
$entPhysicalIndex = null,
|
||||
$hrDeviceIndex = null
|
||||
) {
|
||||
$proc = new static();
|
||||
$proc->processor_type = $type;
|
||||
$proc->device_id = $device_id;
|
||||
$proc->processor_index = $index;
|
||||
$proc->processor_descr = $description;
|
||||
$proc->processor_precision = $precision;
|
||||
$proc->processor_usage = $current_usage;
|
||||
$proc->entPhysicalIndex = $entPhysicalIndex;
|
||||
$proc->hrDeviceIndex = $hrDeviceIndex;
|
||||
|
||||
// handle string indexes
|
||||
if (str_contains($oid, '"')) {
|
||||
$oid = preg_replace_callback('/"([^"]+)"/', function ($matches) {
|
||||
return string_to_oid($matches[1]);
|
||||
}, $oid);
|
||||
}
|
||||
$proc->processor_oid = '.' . ltrim($oid, '.');
|
||||
|
||||
|
||||
if (!is_null($warn_percent)) {
|
||||
$proc->processor_perc_warn = $warn_percent;
|
||||
}
|
||||
|
||||
// validity not checked yet
|
||||
if (is_null($proc->processor_usage)) {
|
||||
$data = snmp_get(device_by_id_cache($proc->device_id), $proc->processor_oid, '-Ovq');
|
||||
$proc->valid = ($data !== false);
|
||||
if (!$proc->valid) {
|
||||
return $proc;
|
||||
}
|
||||
$proc->processor_usage = static::processData($data, $proc->processor_precision);
|
||||
}
|
||||
|
||||
d_echo('Discovered ' . get_called_class() . ' ' . print_r($proc->toArray(), true));
|
||||
|
||||
return $proc;
|
||||
}
|
||||
|
||||
public static function fromYaml(OS $os, $index, array $data)
|
||||
{
|
||||
$precision = $data['precision'] ?: 1;
|
||||
|
||||
return static::discover(
|
||||
$data['type'] ?: $os->getName(),
|
||||
$os->getDeviceId(),
|
||||
$data['num_oid'],
|
||||
isset($data['index']) ? $data['index'] : $index,
|
||||
$data['descr'] ?: 'Processor',
|
||||
$precision,
|
||||
static::processData($data['value'], $precision),
|
||||
$data['warn_percent'],
|
||||
$data['entPhysicalIndex'],
|
||||
$data['hrDeviceIndex']
|
||||
);
|
||||
}
|
||||
|
||||
public static function runDiscovery(OS $os)
|
||||
{
|
||||
// check yaml first
|
||||
$processors = self::processYaml($os);
|
||||
|
||||
// if no processors found, check OS discovery (which will fall back to HR and UCD if not implemented
|
||||
if (empty($processors) && $os instanceof ProcessorDiscovery) {
|
||||
$processors = $os->discoverProcessors();
|
||||
}
|
||||
|
||||
if (isset($processors) && is_array($processors)) {
|
||||
self::sync(
|
||||
$os->getDeviceId(),
|
||||
$processors,
|
||||
array('processor_index', 'processor_type'),
|
||||
array('processor_usage')
|
||||
);
|
||||
}
|
||||
|
||||
dbDeleteOrphans(static::$table, array('devices.device_id'));
|
||||
|
||||
echo PHP_EOL;
|
||||
}
|
||||
|
||||
public static function poll(OS $os)
|
||||
{
|
||||
$processors = dbFetchRows('SELECT * FROM processors WHERE device_id=?', array($os->getDeviceId()));
|
||||
|
||||
if ($os instanceof ProcessorPolling) {
|
||||
$data = $os->pollProcessors($processors);
|
||||
} else {
|
||||
$data = static::pollProcessors($os, $processors);
|
||||
}
|
||||
|
||||
$rrd_def = RrdDefinition::make()->addDataset('usage', 'GAUGE', -273, 1000);
|
||||
|
||||
foreach ($processors as $index => $processor) {
|
||||
extract($processor); // extract db fields to variables
|
||||
/** @var int $processor_id */
|
||||
/** @var string $processor_type */
|
||||
/** @var int $processor_index */
|
||||
/** @var int $processor_usage */
|
||||
|
||||
if (array_key_exists($processor_id, $data)) {
|
||||
$usage = round($data[$processor_id], 2);
|
||||
echo "$usage%\n";
|
||||
|
||||
$rrd_name = array('processor', $processor_type, $processor_index);
|
||||
$fields = compact('usage');
|
||||
$tags = compact('processor_type', 'processor_index', 'rrd_name', 'rrd_def');
|
||||
data_update($os->getDevice(), 'processors', $tags, $fields);
|
||||
|
||||
if ($usage != $processor_usage) {
|
||||
dbUpdate(array('processor_usage' => $usage), 'processors', '`processor_id` = ?', array($processor_id));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static function pollProcessors(OS $os, $processors)
|
||||
{
|
||||
if (empty($processors)) {
|
||||
return array();
|
||||
}
|
||||
|
||||
$oids = array_column($processors, 'processor_oid');
|
||||
|
||||
// don't fetch too many at a time TODO build into snmp_get_multi_oid?
|
||||
$snmp_data = array();
|
||||
foreach (array_chunk($oids, get_device_oid_limit($os->getDevice())) as $oid_chunk) {
|
||||
$multi_data = snmp_get_multi_oid($os->getDevice(), $oid_chunk);
|
||||
$snmp_data = array_merge($snmp_data, $multi_data);
|
||||
}
|
||||
|
||||
d_echo($snmp_data);
|
||||
|
||||
$results = array();
|
||||
foreach ($processors as $processor) {
|
||||
if (isset($snmp_data[$processor['processor_oid']])) {
|
||||
$value = static::processData(
|
||||
$snmp_data[$processor['processor_oid']],
|
||||
$processor['processor_precision']
|
||||
);
|
||||
} else {
|
||||
$value = 0;
|
||||
}
|
||||
|
||||
$results[$processor['processor_id']] = $value;
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
private static function processData($data, $precision)
|
||||
{
|
||||
preg_match('/([0-9]{1,5}(\.[0-9]+)?)/', $data, $matches);
|
||||
$value = $matches[1];
|
||||
|
||||
if ($precision < 0) {
|
||||
// idle value, subtract from 100
|
||||
$value = 100 - ($value / ($precision * -1));
|
||||
} elseif ($precision > 1) {
|
||||
$value = $value / $precision;
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
public static function processYaml(OS $os)
|
||||
{
|
||||
$device = $os->getDevice();
|
||||
if (empty($device['dynamic_discovery']['modules']['processors'])) {
|
||||
d_echo("No YAML Discovery data.\n");
|
||||
return array();
|
||||
}
|
||||
|
||||
return YamlDiscovery::discover($os, get_class(), $device['dynamic_discovery']['modules']['processors']);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Is this sensor valid?
|
||||
* If not, it should not be added to or in the database
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isValid()
|
||||
{
|
||||
return $this->valid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an array of this sensor with fields that line up with the database.
|
||||
*
|
||||
* @param array $exclude exclude columns
|
||||
* @return array
|
||||
*/
|
||||
public function toArray($exclude = array())
|
||||
{
|
||||
$array = array(
|
||||
'processor_id' => $this->processor_id,
|
||||
'entPhysicalIndex' => (int)$this->entPhysicalIndex,
|
||||
'hrDeviceIndex' => (int)$this->hrDeviceIndex,
|
||||
'device_id' => $this->device_id,
|
||||
'processor_oid' => $this->processor_oid,
|
||||
'processor_index' => $this->processor_index,
|
||||
'processor_type' => $this->processor_type,
|
||||
'processor_usage' => $this->processor_usage,
|
||||
'processor_descr' => $this->processor_descr,
|
||||
'processor_precision' => (int)$this->processor_precision,
|
||||
'processor_perc_warn' => (int)$this->processor_perc_warn,
|
||||
);
|
||||
|
||||
return array_diff_key($array, array_flip($exclude));
|
||||
}
|
||||
|
||||
public static function onCreate($processor)
|
||||
{
|
||||
$message = "Processor Discovered: {$processor->processor_type} {$processor->processor_index} {$processor->processor_descr}";
|
||||
log_event($message, $processor->device_id, static::$table, 3, $processor->processor_id);
|
||||
|
||||
parent::onCreate($processor);
|
||||
}
|
||||
|
||||
public static function onDelete($processor)
|
||||
{
|
||||
$message = "Processor Removed: {$processor->processor_type} {$processor->processor_index} {$processor->processor_descr}";
|
||||
log_event($message, $processor->device_id, static::$table, 3, $processor->processor_id);
|
||||
|
||||
parent::onDelete($processor); // TODO: Change the autogenerated stub
|
||||
}
|
||||
}
|
@ -254,7 +254,7 @@ class Sensor implements DiscoveryModule, PollerModule
|
||||
*
|
||||
* @param OS $os
|
||||
*/
|
||||
public static function discover(OS $os)
|
||||
public static function runDiscovery(OS $os)
|
||||
{
|
||||
// Add discovery types here
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ class WirelessSensor extends Sensor
|
||||
return $sensor;
|
||||
}
|
||||
|
||||
public static function discover(OS $os)
|
||||
public static function runDiscovery(OS $os)
|
||||
{
|
||||
foreach (self::getTypes() as $type => $descr) {
|
||||
static::discoverType($os, $type);
|
||||
|
264
LibreNMS/Device/YamlDiscovery.php
Normal file
264
LibreNMS/Device/YamlDiscovery.php
Normal file
@ -0,0 +1,264 @@
|
||||
<?php
|
||||
/**
|
||||
* YamlDiscovery.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\Device;
|
||||
|
||||
use LibreNMS\Interfaces\Discovery\DiscoveryItem;
|
||||
use LibreNMS\OS;
|
||||
|
||||
class YamlDiscovery
|
||||
{
|
||||
/**
|
||||
* @param OS $os
|
||||
* @param DiscoveryItem|string $class
|
||||
* @param $yaml_data
|
||||
* @return array
|
||||
*/
|
||||
public static function discover(OS $os, $class, $yaml_data)
|
||||
{
|
||||
$pre_cache = $os->preCache();
|
||||
$items = array();
|
||||
|
||||
// convert to class name for static call below
|
||||
if (is_object($class)) {
|
||||
$class = get_class($class);
|
||||
}
|
||||
|
||||
d_echo("YAML Discovery Data: ");
|
||||
d_echo($yaml_data);
|
||||
|
||||
foreach ($yaml_data as $first_key => $first_yaml) {
|
||||
if ($first_key == 'pre-cache') {
|
||||
continue;
|
||||
}
|
||||
|
||||
$group_options = isset($first_yaml['options']) ? $first_yaml['options'] : array();
|
||||
|
||||
// find the data array, we could already be at for simple modules
|
||||
if (isset($data['data'])) {
|
||||
$first_yaml = $first_yaml['data'];
|
||||
} elseif ($first_key !== 'data') {
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach ($first_yaml as $data) {
|
||||
$raw_data = (array)$pre_cache[$data['oid']];
|
||||
|
||||
d_echo("Data {$data['oid']}: ");
|
||||
d_echo($raw_data);
|
||||
|
||||
$count = 0;
|
||||
foreach ($raw_data as $index => $snmp_data) {
|
||||
$count++;
|
||||
$current_data = array();
|
||||
|
||||
if (!isset($data['value'])) {
|
||||
$data['value'] = $data['oid'];
|
||||
}
|
||||
|
||||
foreach ($data as $name => $value) {
|
||||
if ($name == '$oid' || $name == 'skip_values') {
|
||||
$current_data[$name] = $value;
|
||||
} elseif (str_contains($value, '{{')) {
|
||||
// replace embedded values
|
||||
$current_data[$name] = static::replaceValues($name, $index, $count, $data, $pre_cache);
|
||||
} else {
|
||||
// replace references to data
|
||||
$current_data[$name] = dynamic_discovery_get_value($name, $index, $data, $pre_cache, $value);
|
||||
}
|
||||
}
|
||||
|
||||
if (static::canSkipItem($current_data['value'], $current_data, $group_options, $snmp_data)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$item = $class::fromYaml($os, $index, $current_data);
|
||||
|
||||
if ($item->isValid()) {
|
||||
$items[] = $item;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $items;
|
||||
}
|
||||
|
||||
|
||||
public static function replaceValues($name, $index, $count, $data, $pre_cache)
|
||||
{
|
||||
$value = dynamic_discovery_get_value($name, $index, $data, $pre_cache);
|
||||
if (is_null($value)) {
|
||||
// built in replacements
|
||||
$value = str_replace(array('{{ $index }}', '{{ $count }}'), array($index, $count), $data[$name]);
|
||||
|
||||
// search discovery data for values
|
||||
$value = preg_replace_callback('/{{ \$([a-zA-Z0-9.]+) }}/', function ($matches) use ($index, $data, $pre_cache) {
|
||||
$replace = dynamic_discovery_get_value($matches[1], $index, $data, $pre_cache, null);
|
||||
if (is_null($replace)) {
|
||||
return $matches[0]; // do no replacement
|
||||
}
|
||||
return $replace;
|
||||
}, $value);
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Helper function for dynamic discovery to search for data from pre_cached snmp data
|
||||
*
|
||||
* @param string $name The name of the field from the discovery data or just an oid
|
||||
* @param int $index The index of the current sensor
|
||||
* @param array $discovery_data The discovery data for the current sensor
|
||||
* @param array $pre_cache all pre-cached snmp data
|
||||
* @param mixed $default The default value to return if data is not found
|
||||
* @return mixed
|
||||
*/
|
||||
public static function getValueFromData($name, $index, $discovery_data, $pre_cache, $default = null)
|
||||
{
|
||||
if (isset($discovery_data[$name])) {
|
||||
$name = $discovery_data[$name];
|
||||
}
|
||||
|
||||
if (isset($pre_cache[$discovery_data['oid']][$index][$name])) {
|
||||
return $pre_cache[$discovery_data['oid']][$index][$name];
|
||||
}
|
||||
|
||||
if (isset($pre_cache[$name])) {
|
||||
if (is_array($pre_cache[$name])) {
|
||||
if (isset($pre_cache[$name][$index][$name])) {
|
||||
return $pre_cache[$name][$index][$name];
|
||||
} elseif (isset($pre_cache[$index][$name])) {
|
||||
return $pre_cache[$index][$name];
|
||||
} elseif (count($pre_cache[$name]) === 1) {
|
||||
return current($pre_cache[$name]);
|
||||
}
|
||||
} else {
|
||||
return $pre_cache[$name];
|
||||
}
|
||||
}
|
||||
|
||||
return $default;
|
||||
}
|
||||
|
||||
public static function preCache(OS $os)
|
||||
{
|
||||
// Pre-cache data for later use
|
||||
$pre_cache = array();
|
||||
$device = $os->getDevice();
|
||||
|
||||
$pre_cache_file = 'includes/discovery/sensors/pre-cache/' . $device['os'] . '.inc.php';
|
||||
if (is_file($pre_cache_file)) {
|
||||
echo "Pre-cache {$device['os']}: ";
|
||||
include $pre_cache_file;
|
||||
echo PHP_EOL;
|
||||
d_echo($pre_cache);
|
||||
}
|
||||
|
||||
// TODO change to exclude os with pre-cache php file, but just exclude them by hand for now (like avtech)
|
||||
if ($device['os'] == 'avtech') {
|
||||
return $pre_cache;
|
||||
}
|
||||
|
||||
if (!empty($device['dynamic_discovery']['modules'])) {
|
||||
echo "Caching data: ";
|
||||
foreach ($device['dynamic_discovery']['modules'] as $module => $discovery_data) {
|
||||
echo "$module ";
|
||||
foreach ($discovery_data as $key => $data_array) {
|
||||
// find the data array, we could already be at for simple modules
|
||||
if (isset($data_array['data'])) {
|
||||
$data_array = $data_array['data'];
|
||||
} elseif ($key !== 'data') {
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach ($data_array as $data) {
|
||||
foreach ((array)$data['oid'] as $oid) {
|
||||
if (!isset($pre_cache[$oid])) {
|
||||
if (isset($data['snmp_flags'])) {
|
||||
$snmp_flag = $data['snmp_flags'];
|
||||
} else {
|
||||
$snmp_flag = '-OeQUs';
|
||||
}
|
||||
$snmp_flag .= ' -Ih';
|
||||
|
||||
$mib = $device['dynamic_discovery']['mib'];
|
||||
$pre_cache[$oid] = snmpwalk_cache_oid($device, $oid, $pre_cache[$oid], $mib, null, $snmp_flag);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
echo PHP_EOL;
|
||||
}
|
||||
|
||||
return $pre_cache;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check to see if we should skip this discovery item
|
||||
*
|
||||
* @param mixed $value
|
||||
* @param array $yaml_item_data The data key from this item
|
||||
* @param array $group_options The options key from this group of items
|
||||
* @param array $item_snmp_data The pre-cache data array
|
||||
* @return bool
|
||||
*/
|
||||
private static function canSkipItem($value, $yaml_item_data, $group_options, $item_snmp_data = array())
|
||||
{
|
||||
$skip_values = array_replace((array)$group_options['skip_values'], (array)$yaml_item_data['skip_values']);
|
||||
|
||||
foreach ($skip_values as $skip_value) {
|
||||
if (is_array($skip_value) && $item_snmp_data) {
|
||||
// Dynamic skipping of data
|
||||
$op = isset($skip_value['op']) ? $skip_value['op'] : '!=';
|
||||
$tmp_value = $item_snmp_data[$skip_value['oid']];
|
||||
if (compare_var($tmp_value, $skip_value['value'], $op)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if ($value == $skip_value) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
$skip_value_lt = array_replace((array)$group_options['skip_value_lt'], (array)$yaml_item_data['skip_value_lt']);
|
||||
foreach ($skip_value_lt as $skip_value) {
|
||||
if ($value < $skip_value) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
$skip_value_gt = array_reduce((array)$group_options['skip_value_gt'], (array)$yaml_item_data['skip_value_gt']);
|
||||
foreach ($skip_value_gt as $skip_value) {
|
||||
if ($value > $skip_value) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
@ -1,8 +1,8 @@
|
||||
<?php
|
||||
/**
|
||||
* dasan-nos.inc.php
|
||||
* FileNotFoundException.php
|
||||
*
|
||||
* LibreNMS processor poller module for Dasan NOS
|
||||
* -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
|
||||
@ -19,8 +19,13 @@
|
||||
*
|
||||
* @package LibreNMS
|
||||
* @link http://librenms.org
|
||||
* @copyright 2016 Neil Lathwood
|
||||
* @author Neil Lathwood <neil@lathwood.co.uk>
|
||||
* @copyright 2018 Tony Murray
|
||||
* @author Tony Murray <murraytony@gmail.com>
|
||||
*/
|
||||
|
||||
$proc = snmp_get($device, 'dsCpuLoad5s.0', '-Ovq', 'DASAN-SWITCH-MIB');
|
||||
namespace LibreNMS\Exceptions;
|
||||
|
||||
class FileNotFoundException extends \Exception
|
||||
{
|
||||
|
||||
}
|
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);
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
<?php
|
||||
/**
|
||||
* apsoluteos.inc.php
|
||||
* ProcessorDiscovery.php
|
||||
*
|
||||
* LibreNMS discovery processor module for DefensePro ( APSoluteOS )
|
||||
* -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
|
||||
@ -19,12 +19,19 @@
|
||||
*
|
||||
* @package LibreNMS
|
||||
* @link http://librenms.org
|
||||
* @copyright 2017 Simone Fini
|
||||
* @author Simone Fini<tomfordfirst@gmail.com>
|
||||
* @copyright 2017 Tony Murray
|
||||
* @author Tony Murray <murraytony@gmail.com>
|
||||
*/
|
||||
|
||||
if ($device['os'] == 'apsoluteos') {
|
||||
$oid = '.1.3.6.1.4.1.89.35.1.54.0';
|
||||
$usage = snmp_walk($device, $oid, '-Ovq');
|
||||
discover_processor($valid['processor'], $device, $oid, 0, 'apsoluteos', 'Processor', '1', $usage);
|
||||
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();
|
||||
}
|
@ -1,8 +1,8 @@
|
||||
<?php
|
||||
/**
|
||||
* 3com.inc.php
|
||||
* ProcessorPolling.php
|
||||
*
|
||||
* LibreNMS processor discovery module for 3com
|
||||
* -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
|
||||
@ -19,16 +19,19 @@
|
||||
*
|
||||
* @package LibreNMS
|
||||
* @link http://librenms.org
|
||||
* @copyright 2017 Neil Lathwood
|
||||
* @author Neil Lathwood <neil@lathwood.co.uk>
|
||||
* @copyright 2017 Tony Murray
|
||||
* @author Tony Murray <murraytony@gmail.com>
|
||||
*/
|
||||
|
||||
if ($device['os'] === '3com') {
|
||||
echo '3COM:';
|
||||
namespace LibreNMS\Interfaces\Polling;
|
||||
|
||||
$usage = snmp_get($device, '.1.3.6.1.4.1.43.45.1.6.1.1.1.3.65536', '-Ovq');
|
||||
if (is_numeric($usage)) {
|
||||
$descr = "Processor";
|
||||
discover_processor($valid['processor'], $device, ".1.3.6.1.4.1.43.45.1.6.1.1.1.3.65536", 0, '3com', $descr, '1', $usage, null, null);
|
||||
}
|
||||
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);
|
||||
}
|
202
LibreNMS/Model.php
Normal file
202
LibreNMS/Model.php
Normal file
@ -0,0 +1,202 @@
|
||||
<?php
|
||||
|
||||
namespace LibreNMS;
|
||||
|
||||
abstract class Model
|
||||
{
|
||||
protected static $table;
|
||||
protected static $primaryKey = 'id';
|
||||
|
||||
public static function create(array $data)
|
||||
{
|
||||
$instance = new static();
|
||||
$instance->fill($data);
|
||||
return $instance;
|
||||
}
|
||||
|
||||
protected function fill(array $data = array())
|
||||
{
|
||||
foreach ($data as $field => $value) {
|
||||
$this->$field = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Save Models and remove invalid Models
|
||||
* This the sensors array should contain all the sensors of a specific class
|
||||
* It may contain sensors from multiple tables and devices, but that isn't the primary use
|
||||
*
|
||||
* @param int $device_id
|
||||
* @param array $models
|
||||
* @param array $unique_fields fields to search for an existing entry
|
||||
* @param array $ignored_update_fields Don't compare these field when updating
|
||||
*/
|
||||
final public static function sync($device_id, array $models, $unique_fields = array(), $ignored_update_fields = array())
|
||||
{
|
||||
// save and collect valid ids
|
||||
$valid_ids = array();
|
||||
foreach ($models as $model) {
|
||||
/** @var $this $model */
|
||||
if ($model->isValid()) {
|
||||
$valid_ids[] = $model->save($unique_fields, $ignored_update_fields);
|
||||
}
|
||||
}
|
||||
|
||||
// delete invalid sensors
|
||||
self::clean($device_id, $valid_ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove invalid Models. Passing an empty array will remove all models related to $device_id
|
||||
*
|
||||
* @param int $device_id
|
||||
* @param array $model_ids valid Model ids
|
||||
*/
|
||||
protected static function clean($device_id, $model_ids)
|
||||
{
|
||||
$table = static::$table;
|
||||
$key = static::$primaryKey;
|
||||
|
||||
$params = array($device_id);
|
||||
$where = '`device_id`=?';
|
||||
|
||||
if (!empty($model_ids)) {
|
||||
$where .= " AND `$key` NOT IN " . dbGenPlaceholders(count($model_ids));
|
||||
$params = array_merge($params, $model_ids);
|
||||
}
|
||||
|
||||
$rows = dbFetchRows("SELECT * FROM `$table` WHERE $where", $params);
|
||||
foreach ($rows as $row) {
|
||||
static::onDelete(static::create($row));
|
||||
}
|
||||
if (!empty($rows)) {
|
||||
dbDelete($table, $where, $params);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Save this Model to the database.
|
||||
*
|
||||
* @param array $unique_fields fields to search for an existing entry
|
||||
* @param array $ignored_update_fields Don't compare these field when updating
|
||||
* @return int the id of this model in the database
|
||||
*/
|
||||
final public function save($unique_fields = array(), $ignored_update_fields = array())
|
||||
{
|
||||
$db_model = $this->fetch($unique_fields);
|
||||
$key = static::$primaryKey;
|
||||
|
||||
if ($db_model) {
|
||||
$new_model = $this->toArray(array_merge(array($key), $ignored_update_fields));
|
||||
$update = array_diff($new_model, $db_model);
|
||||
|
||||
if (empty($update)) {
|
||||
static::onNoUpdate();
|
||||
} else {
|
||||
dbUpdate($update, static::$table, "`$key`=?", array($this->$key));
|
||||
static::onUpdate($this);
|
||||
}
|
||||
} else {
|
||||
$new_model = $this->toArray(array($key));
|
||||
$this->$key = dbInsert($new_model, static::$table);
|
||||
if ($this->$key !== null) {
|
||||
static::onCreate($this);
|
||||
}
|
||||
}
|
||||
|
||||
return $this->$key;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch the sensor from the database.
|
||||
* If it doesn't exist, returns null.
|
||||
*
|
||||
* @param array $unique_fields fields to search for an existing entry
|
||||
* @return array|null
|
||||
*/
|
||||
protected function fetch($unique_fields = array())
|
||||
{
|
||||
$table = static::$table;
|
||||
$key = static::$primaryKey;
|
||||
|
||||
if (isset($this->id)) {
|
||||
return dbFetchRow(
|
||||
"SELECT `$table` FROM ? WHERE `$key`=?",
|
||||
array($this->$key)
|
||||
);
|
||||
}
|
||||
|
||||
$where = array();
|
||||
$params = array();
|
||||
foreach ($unique_fields as $field) {
|
||||
if (isset($this->$field)) {
|
||||
$where[] = " $field=?";
|
||||
$params[] = $this->$field;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($params)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$row = dbFetchRow(
|
||||
"SELECT * FROM `$table` WHERE " . implode(' AND', $where),
|
||||
$params
|
||||
);
|
||||
|
||||
$this->$key = $row[$key];
|
||||
return $row;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert this Model to an array with fields that match the database
|
||||
*
|
||||
* @param array $exclude Exclude the listed fields
|
||||
* @return array
|
||||
*/
|
||||
abstract public function toArray($exclude = array());
|
||||
|
||||
/**
|
||||
* Returns if this model passes validation and should be saved to the database
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
abstract public function isValid();
|
||||
|
||||
/**
|
||||
* @param static $model
|
||||
*/
|
||||
public static function onDelete($model)
|
||||
{
|
||||
if (isCli()) {
|
||||
echo '-';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param static $model
|
||||
*/
|
||||
public static function onCreate($model)
|
||||
{
|
||||
if (isCli()) {
|
||||
echo '+';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param static $model
|
||||
*/
|
||||
public static function onUpdate($model)
|
||||
{
|
||||
if (isCli()) {
|
||||
echo 'U';
|
||||
}
|
||||
}
|
||||
|
||||
public static function onNoUpdate()
|
||||
{
|
||||
if (isCli()) {
|
||||
echo '.';
|
||||
}
|
||||
}
|
||||
}
|
117
LibreNMS/OS.php
117
LibreNMS/OS.php
@ -25,14 +25,25 @@
|
||||
|
||||
namespace LibreNMS;
|
||||
|
||||
use LibreNMS\Device\Discovery\Sensors\WirelessSensorDiscovery;
|
||||
use LibreNMS\Device\Discovery\Sensors\WirelessSensorPolling;
|
||||
use LibreNMS\Device\WirelessSensor;
|
||||
use LibreNMS\Device\YamlDiscovery;
|
||||
use LibreNMS\Interfaces\Discovery\ProcessorDiscovery;
|
||||
use LibreNMS\OS\Generic;
|
||||
use LibreNMS\OS\Traits\HostResources;
|
||||
use LibreNMS\OS\Traits\UcdResources;
|
||||
|
||||
class OS
|
||||
class OS implements ProcessorDiscovery
|
||||
{
|
||||
use HostResources {
|
||||
HostResources::discoverProcessors as discoverHrProcessors;
|
||||
}
|
||||
use UcdResources {
|
||||
UcdResources::discoverProcessors as discoverUcdProcessors;
|
||||
}
|
||||
|
||||
private $device; // annoying use of references to make sure this is in sync with global $device variable
|
||||
private $cache; // data cache
|
||||
private $pre_cache; // pre-fetch data cache
|
||||
|
||||
/**
|
||||
* OS constructor. Not allowed to be created directly. Use OS::make()
|
||||
@ -63,6 +74,15 @@ class OS
|
||||
return (int)$this->device['device_id'];
|
||||
}
|
||||
|
||||
public function preCache()
|
||||
{
|
||||
if (is_null($this->pre_cache)) {
|
||||
$this->pre_cache = YamlDiscovery::preCache($this);
|
||||
}
|
||||
|
||||
return $this->pre_cache;
|
||||
}
|
||||
|
||||
/**
|
||||
* Snmpwalk the specified oid and return an array of the data indexed by the oid index.
|
||||
* If the data is cached, return the cached data.
|
||||
@ -71,25 +91,60 @@ class OS
|
||||
* @param string $oid textual oid
|
||||
* @param string $mib mib for this oid
|
||||
* @return array array indexed by the snmp index with the value as the data returned by snmp
|
||||
* @throws \Exception
|
||||
*/
|
||||
protected function getCacheByIndex($oid, $mib = null)
|
||||
public function getCacheByIndex($oid, $mib = null)
|
||||
{
|
||||
if (str_contains($oid, '.')) {
|
||||
throw new \Exception('Error: don\'t use this with numeric oids');
|
||||
echo "Error: don't use this with numeric oids!\n";
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!isset($this->$oid)) {
|
||||
if (!isset($this->cache[$oid])) {
|
||||
$data = snmpwalk_cache_oid($this->getDevice(), $oid, array(), $mib);
|
||||
$this->$oid = array_map('current', $data);
|
||||
$this->cache[$oid] = array_map('current', $data);
|
||||
}
|
||||
|
||||
return $this->$oid;
|
||||
return $this->cache[$oid];
|
||||
}
|
||||
|
||||
/**
|
||||
* Snmpwalk the specified oid table and return an array of the data indexed by the oid index.
|
||||
* If the data is cached, return the cached data.
|
||||
* DO NOT use numeric oids with this function! The snmp result must contain only one oid.
|
||||
*
|
||||
* @param string $oid textual oid
|
||||
* @param string $mib mib for this oid
|
||||
* @return array array indexed by the snmp index with the value as the data returned by snmp
|
||||
*/
|
||||
public function getCacheTable($oid, $mib = null)
|
||||
{
|
||||
if (str_contains($oid, '.')) {
|
||||
echo "Error: don't use this with numeric oids!\n";
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!isset($this->cache[$oid])) {
|
||||
$this->cache[$oid] = snmpwalk_group($this->getDevice(), $oid, $mib);
|
||||
}
|
||||
|
||||
return $this->cache[$oid];
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if an OID has been cached
|
||||
*
|
||||
* @param $oid
|
||||
* @return bool
|
||||
*/
|
||||
public function isCached($oid)
|
||||
{
|
||||
return isset($this->cache[$oid]);
|
||||
}
|
||||
|
||||
/**
|
||||
* OS Factory, returns an instance of the OS for this device
|
||||
* If no specific OS is found, returns Generic
|
||||
* If no specific OS is found, Try the OS group.
|
||||
* Otherwise, returns Generic
|
||||
*
|
||||
* @param array $device device array, must have os set
|
||||
* @return OS
|
||||
@ -103,9 +158,34 @@ class OS
|
||||
return new $class($device);
|
||||
}
|
||||
|
||||
// If not a specific OS, check for a group one.
|
||||
if (isset($device['os_group'])) {
|
||||
$class = str_to_class($device['os_group'], 'LibreNMS\\OS\\Shared\\');
|
||||
d_echo('Attempting to initialize OS: ' . $device['os_group'] . PHP_EOL);
|
||||
if (class_exists($class)) {
|
||||
d_echo("OS initialized: $class\n");
|
||||
return new $class($device);
|
||||
}
|
||||
}
|
||||
|
||||
d_echo("OS initilized as Generic\n");
|
||||
return new Generic($device);
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
if (isset($this->device['os'])) {
|
||||
return $this->device['os'];
|
||||
}
|
||||
|
||||
$rf = new \ReflectionClass($this);
|
||||
$name = $rf->getShortName();
|
||||
var_dump($name);
|
||||
preg_match_all("/[A-Z][a-z]*/", $name, $segments);
|
||||
|
||||
return implode('-', array_map('strtolower', $segments[0]));
|
||||
}
|
||||
|
||||
/**
|
||||
* Poll a channel based OID, but return data in MHz
|
||||
*
|
||||
@ -139,4 +219,21 @@ class OS
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Discover processors.
|
||||
* Returns an array of LibreNMS\Device\Processor objects that have been discovered
|
||||
*
|
||||
* @return array Processors
|
||||
*/
|
||||
public function discoverProcessors()
|
||||
{
|
||||
$processors = $this->discoverHrProcessors();
|
||||
|
||||
if (empty($processors)) {
|
||||
$processors = $this->discoverUcdProcessors();
|
||||
}
|
||||
|
||||
return $processors;
|
||||
}
|
||||
}
|
||||
|
58
LibreNMS/OS/Aen.php
Normal file
58
LibreNMS/OS/Aen.php
Normal file
@ -0,0 +1,58 @@
|
||||
<?php
|
||||
/**
|
||||
* Aen.php
|
||||
*
|
||||
* Accedian OS
|
||||
*
|
||||
* 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\OS;
|
||||
|
||||
use LibreNMS\Device\Processor;
|
||||
use LibreNMS\Interfaces\Discovery\ProcessorDiscovery;
|
||||
use LibreNMS\OS;
|
||||
|
||||
class Aen extends OS implements ProcessorDiscovery
|
||||
{
|
||||
/**
|
||||
* Discover processors.
|
||||
* Returns an array of LibreNMS\Device\Processor objects that have been discovered
|
||||
*
|
||||
* @return array Processors
|
||||
*/
|
||||
public function discoverProcessors()
|
||||
{
|
||||
$device = $this->getDevice();
|
||||
|
||||
// don't poll v5.3.1_22558 devices due to bug that crashes snmpd
|
||||
if ($device['version'] == 'AEN_5.3.1_22558') {
|
||||
return array();
|
||||
}
|
||||
|
||||
return array(
|
||||
Processor::discover(
|
||||
$this->getName(),
|
||||
$this->getDeviceId(),
|
||||
'.1.3.6.1.4.1.22420.1.1.20.0', // ACD-DESC-MIB::acdDescCpuUsageCurrent
|
||||
0
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
67
LibreNMS/OS/Aos.php
Normal file
67
LibreNMS/OS/Aos.php
Normal file
@ -0,0 +1,67 @@
|
||||
<?php
|
||||
/**
|
||||
* Aos.php
|
||||
*
|
||||
* Alcatel-Lucent AOS
|
||||
*
|
||||
* 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\OS;
|
||||
|
||||
use LibreNMS\Device\Processor;
|
||||
use LibreNMS\Interfaces\Discovery\ProcessorDiscovery;
|
||||
use LibreNMS\OS;
|
||||
|
||||
class Aos extends OS implements ProcessorDiscovery
|
||||
{
|
||||
/**
|
||||
* Discover processors.
|
||||
* Returns an array of LibreNMS\Device\Processor objects that have been discovered
|
||||
*
|
||||
* @return array Processors
|
||||
*/
|
||||
public function discoverProcessors()
|
||||
{
|
||||
$processor = Processor::discover(
|
||||
'aos-system',
|
||||
$this->getDeviceId(),
|
||||
'.1.3.6.1.4.1.6486.800.1.2.1.16.1.1.1.13.0', // ALCATEL-IND1-HEALTH-MIB::healthDeviceCpuLatest
|
||||
0,
|
||||
'Device CPU'
|
||||
);
|
||||
|
||||
if (!$processor->isValid()) {
|
||||
// AOS7 devices use a different OID for CPU load. Not all Switches have
|
||||
// healthModuleCpuLatest so we use healthModuleCpu1MinAvg which makes no
|
||||
// difference for a 5 min. polling interval.
|
||||
// Note: This OID shows (a) the CPU load of a single switch or (b) the
|
||||
// average CPU load of all CPUs in a stack of switches.
|
||||
$processor = Processor::discover(
|
||||
'aos-system',
|
||||
$this->getDeviceId(),
|
||||
'.1.3.6.1.4.1.6486.801.1.2.1.16.1.1.1.1.1.11.0',
|
||||
0,
|
||||
'Device CPU'
|
||||
);
|
||||
}
|
||||
|
||||
return array($processor);
|
||||
}
|
||||
}
|
63
LibreNMS/OS/AvayaErs.php
Normal file
63
LibreNMS/OS/AvayaErs.php
Normal file
@ -0,0 +1,63 @@
|
||||
<?php
|
||||
/**
|
||||
* AvayaErs.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 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 AvayaErs extends OS implements ProcessorDiscovery
|
||||
{
|
||||
/**
|
||||
* Discover processors.
|
||||
* Returns an array of LibreNMS\Device\Processor objects that have been discovered
|
||||
*
|
||||
* @return array Processors
|
||||
*/
|
||||
public function discoverProcessors()
|
||||
{
|
||||
$data = snmpwalk_group($this->getDevice(), 's5ChasUtilCPUUsageLast10Minutes', 'S5-CHASSIS-MIB');
|
||||
|
||||
$processors = array();
|
||||
$count = 1;
|
||||
foreach ($data as $index => $entry) {
|
||||
$processors[] = Processor::discover(
|
||||
$this->getName(),
|
||||
$this->getDeviceId(),
|
||||
".1.3.6.1.4.1.45.1.6.3.8.1.1.6.$index",
|
||||
zeropad($count),
|
||||
"Unit $count processor",
|
||||
1,
|
||||
$entry['sgProxyCpuCoreBusyPerCent']
|
||||
);
|
||||
|
||||
$count++;
|
||||
}
|
||||
|
||||
|
||||
return $processors;
|
||||
}
|
||||
}
|
@ -26,11 +26,15 @@
|
||||
namespace LibreNMS\OS;
|
||||
|
||||
use LibreNMS\Device\WirelessSensor;
|
||||
use LibreNMS\Interfaces\Discovery\ProcessorDiscovery;
|
||||
use LibreNMS\Interfaces\Discovery\Sensors\WirelessApCountDiscovery;
|
||||
use LibreNMS\Interfaces\Discovery\Sensors\WirelessClientsDiscovery;
|
||||
use LibreNMS\OS;
|
||||
use LibreNMS\OS\Shared\Cisco;
|
||||
|
||||
class Ciscowlc extends OS implements WirelessClientsDiscovery, WirelessApCountDiscovery
|
||||
class Ciscowlc extends Cisco implements
|
||||
WirelessClientsDiscovery,
|
||||
WirelessApCountDiscovery
|
||||
{
|
||||
/**
|
||||
* Discover wireless client counts. Type is clients.
|
||||
|
68
LibreNMS/OS/Comware.php
Normal file
68
LibreNMS/OS/Comware.php
Normal file
@ -0,0 +1,68 @@
|
||||
<?php
|
||||
/**
|
||||
* Comware.php
|
||||
*
|
||||
* H3C/HPE Comware OS
|
||||
*
|
||||
* 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 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 Comware extends OS implements ProcessorDiscovery
|
||||
{
|
||||
/**
|
||||
* Discover processors.
|
||||
* Returns an array of LibreNMS\Device\Processor objects that have been discovered
|
||||
*
|
||||
* @return array Processors
|
||||
*/
|
||||
public function discoverProcessors()
|
||||
{
|
||||
$procdata = $this->getCacheByIndex('hh3cEntityExtCpuUsage', 'HH3C-ENTITY-EXT-MIB');
|
||||
|
||||
if (!empty($procdata)) {
|
||||
$entity_data = $this->getCacheByIndex('entPhysicalName', 'ENTITY-MIB');
|
||||
}
|
||||
|
||||
$processors = array();
|
||||
|
||||
foreach ($procdata as $index => $usage) {
|
||||
if ($usage != 0) {
|
||||
$processors[] = Processor::discover(
|
||||
$this->getName(),
|
||||
$this->getDeviceId(),
|
||||
".1.3.6.1.4.1.25506.2.6.1.1.1.1.6.$index",
|
||||
$index,
|
||||
$entity_data[$index],
|
||||
1,
|
||||
$usage,
|
||||
null,
|
||||
$index
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return $processors;
|
||||
}
|
||||
}
|
53
LibreNMS/OS/Dlinkap.php
Normal file
53
LibreNMS/OS/Dlinkap.php
Normal file
@ -0,0 +1,53 @@
|
||||
<?php
|
||||
/**
|
||||
* Dlinkap.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 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 Dlinkap extends OS implements ProcessorDiscovery
|
||||
{
|
||||
/**
|
||||
* Discover processors.
|
||||
* Returns an array of LibreNMS\Device\Processor objects that have been discovered
|
||||
*
|
||||
* @return array Processors
|
||||
*/
|
||||
public function discoverProcessors()
|
||||
{
|
||||
return array(
|
||||
Processor::discover(
|
||||
'dlinkap-cpu',
|
||||
$this->getDeviceId(),
|
||||
$this->getDevice()['sysObjectID'] . '.5.1.3.0', // different OID for each model
|
||||
0,
|
||||
'Processor',
|
||||
100
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
119
LibreNMS/OS/Dnos.php
Normal file
119
LibreNMS/OS/Dnos.php
Normal file
@ -0,0 +1,119 @@
|
||||
<?php
|
||||
/**
|
||||
* Dnos.php
|
||||
*
|
||||
* Dell Network OS
|
||||
*
|
||||
* 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 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 Dnos extends OS implements ProcessorDiscovery
|
||||
{
|
||||
/**
|
||||
* Discover processors.
|
||||
* Returns an array of LibreNMS\Device\Processor objects that have been discovered
|
||||
*
|
||||
* @return array Processors
|
||||
*/
|
||||
public function discoverProcessors()
|
||||
{
|
||||
$device = $this->getDevice();
|
||||
$processors = array();
|
||||
|
||||
if (starts_with($device['sysObjectID'], '.1.3.6.1.4.1.6027.1.3')) {
|
||||
d_echo('Dell S Series Chassis');
|
||||
$this->findProcessors(
|
||||
$processors,
|
||||
'chStackUnitCpuUtil5Sec',
|
||||
'F10-S-SERIES-CHASSIS-MIB',
|
||||
'.1.3.6.1.4.1.6027.3.10.1.2.9.1.2',
|
||||
'Stack Unit'
|
||||
);
|
||||
} elseif (starts_with($device['sysObjectID'], '.1.3.6.1.4.1.6027.1.2')) {
|
||||
d_echo('Dell C Series Chassis');
|
||||
$this->findProcessors(
|
||||
$processors,
|
||||
'chRpmCpuUtil5Sec',
|
||||
'F10-C-SERIES-CHASSIS-MIB',
|
||||
'.1.3.6.1.4.1.6027.3.8.1.3.7.1.3',
|
||||
'Route Process Module',
|
||||
$this->getName() . '-rpm'
|
||||
);
|
||||
$this->findProcessors(
|
||||
$processors,
|
||||
'chLineCardCpuUtil5Sec',
|
||||
'F10-C-SERIES-CHASSIS-MIB',
|
||||
'.1.3.6.1.4.1.6027.3.8.1.5.1.1.1',
|
||||
'Line Card'
|
||||
);
|
||||
} elseif (starts_with($device['sysObjectID'], '.1.3.6.1.4.1.6027.1.4')) {
|
||||
d_echo('Dell M Series Chassis');
|
||||
$this->findProcessors(
|
||||
$processors,
|
||||
'chStackUnitCpuUtil5Sec',
|
||||
'F10-M-SERIES-CHASSIS-MIB',
|
||||
'.1.3.6.1.4.1.6027.3.19.1.2.8.1.2',
|
||||
'Stack Unit'
|
||||
);
|
||||
} elseif (starts_with($device['sysObjectID'], '.1.3.6.1.4.1.6027.1.5')) {
|
||||
d_echo('Dell Z Series Chassis');
|
||||
$this->findProcessors(
|
||||
$processors,
|
||||
'chSysCpuUtil5Sec',
|
||||
'F10-Z-SERIES-CHASSIS-MIB',
|
||||
'.1.3.6.1.4.1.6027.3.25.1.2.3.1.1',
|
||||
'Chassis'
|
||||
);
|
||||
}
|
||||
|
||||
return $processors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find processors and append them to the $processors array
|
||||
*
|
||||
* @param array $processors
|
||||
* @param string $oid Textual OIDf
|
||||
* @param string $mib MIB
|
||||
* @param string $num_oid Numerical OID
|
||||
* @param string $name Name prefix to display to user
|
||||
* @param string custom type (if there are multiple in one chassis)
|
||||
*/
|
||||
private function findProcessors(&$processors, $oid, $mib, $num_oid, $name, $type = null)
|
||||
{
|
||||
$data = $this->getCacheByIndex($oid, $mib);
|
||||
foreach ($data as $index => $usage) {
|
||||
$processors[] = Processor::discover(
|
||||
$type ?: $this->getName(),
|
||||
$this->getDeviceId(),
|
||||
"$num_oid.$index",
|
||||
$index,
|
||||
"$name $index CPU",
|
||||
1,
|
||||
$usage
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
77
LibreNMS/OS/Edgecos.php
Normal file
77
LibreNMS/OS/Edgecos.php
Normal file
@ -0,0 +1,77 @@
|
||||
<?php
|
||||
/**
|
||||
* Edgecos.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 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 Edgecos extends OS implements ProcessorDiscovery
|
||||
{
|
||||
/**
|
||||
* Discover processors.
|
||||
* Returns an array of LibreNMS\Device\Processor objects that have been discovered
|
||||
*
|
||||
* @return array Processors
|
||||
*/
|
||||
public function discoverProcessors()
|
||||
{
|
||||
$device = $this->getDevice();
|
||||
|
||||
if (starts_with($device['sysObjectID'], '.1.3.6.1.4.1.259.10.1.24.')) { //ECS4510
|
||||
$oid = '.1.3.6.1.4.1.259.10.1.24.1.39.2.1.0';
|
||||
};
|
||||
|
||||
if (starts_with($device['sysObjectID'], '.1.3.6.1.4.1.259.10.1.22.')) { //ECS3528
|
||||
$oid = '.1.3.6.1.4.1.259.10.1.22.1.39.2.1.0';
|
||||
};
|
||||
|
||||
if (starts_with($device['sysObjectID'], '.1.3.6.1.4.1.259.10.1.45.')) { //ECS4120
|
||||
$oid = '.1.3.6.1.4.1.259.10.1.45.1.39.2.1.0';
|
||||
};
|
||||
|
||||
if (starts_with($device['sysObjectID'], '.1.3.6.1.4.1.259.10.1.42.')) { //ECS4210
|
||||
$oid = '.1.3.6.1.4.1.259.10.1.42.101.1.39.2.1.0';
|
||||
};
|
||||
|
||||
if (starts_with($device['sysObjectID'], '.1.3.6.1.4.1.259.10.1.27.')) { //ECS3510
|
||||
$oid = '.1.3.6.1.4.1.259.10.1.27.1.39.2.1.0';
|
||||
};
|
||||
|
||||
if (isset($oid)) {
|
||||
return array(
|
||||
Processor::discover(
|
||||
$this->getName(),
|
||||
$this->getDeviceId(),
|
||||
$oid,
|
||||
0
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return array();
|
||||
}
|
||||
}
|
36
LibreNMS/OS/Edgeswitch.php
Normal file
36
LibreNMS/OS/Edgeswitch.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
/**
|
||||
* Edgeswitch.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 2018 Tony Murray
|
||||
* @author Tony Murray <murraytony@gmail.com>
|
||||
*/
|
||||
|
||||
namespace LibreNMS\OS;
|
||||
|
||||
use LibreNMS\Device\Processor;
|
||||
use LibreNMS\Interfaces\Discovery\ProcessorDiscovery;
|
||||
use LibreNMS\Interfaces\Polling\ProcessorPolling;
|
||||
use LibreNMS\OS;
|
||||
|
||||
class Edgeswitch extends OS implements ProcessorDiscovery, ProcessorPolling
|
||||
{
|
||||
use OS\Traits\VxworksProcessorUsage;
|
||||
}
|
@ -1,8 +1,8 @@
|
||||
<?php
|
||||
/**
|
||||
* eltex-olt.inc.php
|
||||
* Ftos.php
|
||||
*
|
||||
* LibreNMS processor poller module for Eltex OLT
|
||||
* Dell Force10 OS
|
||||
*
|
||||
* 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
|
||||
@ -19,8 +19,13 @@
|
||||
*
|
||||
* @package LibreNMS
|
||||
* @link http://librenms.org
|
||||
* @copyright 2017 Neil Lathwood
|
||||
* @author Neil Lathwood <neil@lathwood.co.uk>
|
||||
* @copyright 2018 Tony Murray
|
||||
* @author Tony Murray <murraytony@gmail.com>
|
||||
*/
|
||||
|
||||
$proc = snmp_get($device, 'ltp8xCPULoadAverage5Minutes.0', '-Ovq', 'ELTEX-LTP8X-STANDALONE') / 10;
|
||||
namespace LibreNMS\OS;
|
||||
|
||||
class Ftos extends Dnos
|
||||
{
|
||||
// not sure why this is a separate OS
|
||||
}
|
@ -1,8 +1,8 @@
|
||||
<?php
|
||||
/**
|
||||
* netonix.inc.php
|
||||
* Infinity.php
|
||||
*
|
||||
* LibreNMS processors module for Netonix
|
||||
* -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
|
||||
@ -19,16 +19,16 @@
|
||||
*
|
||||
* @package LibreNMS
|
||||
* @link http://librenms.org
|
||||
* @copyright 2016 Tony Murray
|
||||
* @copyright 2018 Tony Murray
|
||||
* @author Tony Murray <murraytony@gmail.com>
|
||||
*/
|
||||
|
||||
if ($device['os'] == 'netonix') {
|
||||
echo 'NETONIX : ';
|
||||
namespace LibreNMS\OS;
|
||||
|
||||
$idle = snmp_get($device, 'UCD-SNMP-MIB::ssCpuIdle.0', '-OvQ');
|
||||
use LibreNMS\Interfaces\Discovery\ProcessorDiscovery;
|
||||
use LibreNMS\OS;
|
||||
|
||||
if (is_numeric($idle)) {
|
||||
discover_processor($valid['processor'], $device, 0, 0, 'ucd-old', 'CPU', '1', (100 - $idle));
|
||||
}
|
||||
class Infinity extends OS implements ProcessorDiscovery
|
||||
{
|
||||
use OS\Traits\FrogfootResources;
|
||||
}
|
@ -26,11 +26,13 @@
|
||||
namespace LibreNMS\OS;
|
||||
|
||||
use LibreNMS\Device\WirelessSensor;
|
||||
use LibreNMS\Interfaces\Discovery\ProcessorDiscovery;
|
||||
use LibreNMS\Interfaces\Discovery\Sensors\WirelessClientsDiscovery;
|
||||
use LibreNMS\Interfaces\Discovery\Sensors\WirelessRssiDiscovery;
|
||||
use LibreNMS\OS;
|
||||
use LibreNMS\OS\Shared\Cisco;
|
||||
|
||||
class Ios extends OS implements
|
||||
class Ios extends Cisco implements
|
||||
WirelessClientsDiscovery,
|
||||
WirelessRssiDiscovery
|
||||
{
|
||||
|
@ -1,8 +1,8 @@
|
||||
<?php
|
||||
/**
|
||||
* saf-integra.inc.php
|
||||
* Ironware.php
|
||||
*
|
||||
* LibreNMS processor poller module for Saf Integra
|
||||
* Brocade Ironware OS
|
||||
*
|
||||
* 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
|
||||
@ -19,18 +19,15 @@
|
||||
*
|
||||
* @package LibreNMS
|
||||
* @link http://librenms.org
|
||||
* @copyright 2017 Neil Lathwood
|
||||
* @author Neil Lathwood <neil@lathwood.co.uk>
|
||||
* @copyright 2018 Tony Murray
|
||||
* @author Tony Murray <murraytony@gmail.com>
|
||||
*/
|
||||
|
||||
$oid = '.1.3.6.1.4.1.7571.100.1.1.7.2.4.10.0';
|
||||
$usage = snmp_get($device, $oid, '-Ovqn');
|
||||
namespace LibreNMS\OS;
|
||||
|
||||
use LibreNMS\OS\Shared\Foundry;
|
||||
|
||||
class Ironware extends Foundry
|
||||
{
|
||||
|
||||
if (is_numeric($usage)) {
|
||||
$usage = 100 - ($usage / 10);
|
||||
}
|
||||
|
||||
unset(
|
||||
$oid,
|
||||
$usage
|
||||
);
|
64
LibreNMS/OS/MoxaEtherdevice.php
Normal file
64
LibreNMS/OS/MoxaEtherdevice.php
Normal file
@ -0,0 +1,64 @@
|
||||
<?php
|
||||
/**
|
||||
* MoxaEtherdevice.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 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 MoxaEtherdevice extends OS implements ProcessorDiscovery
|
||||
{
|
||||
/**
|
||||
* Discover processors.
|
||||
* Returns an array of LibreNMS\Device\Processor objects that have been discovered
|
||||
*
|
||||
* @return array Processors
|
||||
*/
|
||||
public function discoverProcessors()
|
||||
{
|
||||
$device = $this->getDevice();
|
||||
|
||||
// Moxa people enjoy creating MIBs for each model!
|
||||
// .1.3.6.1.4.1.8691.7.116.1.54.0 = MOXA-IKS6726A-MIB::cpuLoading30s.0
|
||||
// .1.3.6.1.4.1.8691.7.69.1.54.0 = MOXA-EDSG508E-MIB::cpuLoading30s.0
|
||||
$oid = $device['sysObjectID'] . '.1.54.0';
|
||||
|
||||
if ($device['sysDescr'] == 'IKS-6726A-2GTXSFP-T') {
|
||||
$oid = '.1.3.6.1.4.1.8691.7.116.1.54.0'; // MOXA-IKS6726A-MIB::cpuLoading30s.0
|
||||
} else if ($device['sysDescr'] == 'EDS-G508E-T') {
|
||||
$oid = '.1.3.6.1.4.1.8691.7.69.1.54.0'; // MOXA-EDSG508E-MIB::cpuLoading30s.0
|
||||
}
|
||||
|
||||
return array(
|
||||
Processor::discover(
|
||||
$this->getName(),
|
||||
$this->getDeviceId(),
|
||||
$oid,
|
||||
0
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
90
LibreNMS/OS/Powerconnect.php
Normal file
90
LibreNMS/OS/Powerconnect.php
Normal file
@ -0,0 +1,90 @@
|
||||
<?php
|
||||
/**
|
||||
* Powerconnect.php
|
||||
*
|
||||
* Dell PowerConnect
|
||||
*
|
||||
* 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 2018 Tony Murray
|
||||
* @author Tony Murray <murraytony@gmail.com>
|
||||
*/
|
||||
|
||||
namespace LibreNMS\OS;
|
||||
|
||||
use LibreNMS\Device\Processor;
|
||||
use LibreNMS\Interfaces\Discovery\ProcessorDiscovery;
|
||||
use LibreNMS\Interfaces\Polling\ProcessorPolling;
|
||||
use LibreNMS\OS;
|
||||
use LibreNMS\OS\Traits\VxworksProcessorUsage;
|
||||
|
||||
class Powerconnect extends OS implements ProcessorDiscovery, ProcessorPolling
|
||||
{
|
||||
// pull in VxWorks processor parsing, but allow us to extend it
|
||||
use VxworksProcessorUsage {
|
||||
VxworksProcessorUsage::discoverProcessors as discoverVxworksProcessors;
|
||||
VxworksProcessorUsage::pollProcessors as pollVxworksProcessors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Discover processors.
|
||||
* Returns an array of LibreNMS\Device\Processor objects that have been discovered
|
||||
*
|
||||
* @return array Processors
|
||||
*/
|
||||
public function discoverProcessors()
|
||||
{
|
||||
$device = $this->getDevice();
|
||||
|
||||
if (starts_with($device['sysObjectID'], '.1.3.6.1.4.1.674.10895.3031')) {
|
||||
d_echo("Dell Powerconnect 55xx");
|
||||
return array(
|
||||
Processor::discover(
|
||||
'powerconnect-nv',
|
||||
$this->getDeviceId(),
|
||||
'.1.3.6.1.4.1.89.1.7.0',
|
||||
0
|
||||
)
|
||||
);
|
||||
} elseif (starts_with($device['sysObjectID'], '.1.3.6.1.4.1.674.10895.3024')) {
|
||||
d_echo("Dell Powerconnect 8024F");
|
||||
return $this->discoverVxworksProcessors('.1.3.6.1.4.1.674.10895.5000.2.6132.1.1.1.1.4.9.0');
|
||||
}
|
||||
|
||||
return $this->discoverVxworksProcessors('.1.3.6.1.4.1.674.10895.5000.2.6132.1.1.1.1.4.4.0');
|
||||
}
|
||||
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
$data = array();
|
||||
|
||||
foreach ($processors as $processor) {
|
||||
if ($processor['processor_type'] == 'powerconnect-nv') {
|
||||
$data[$processor['processor_id']] = snmp_get($this->getDevice(), $processor['processor_oid'], '-Oqv');
|
||||
} else {
|
||||
$data += $this->pollVxworksProcessors(array($processor));
|
||||
}
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
}
|
@ -1,8 +1,8 @@
|
||||
<?php
|
||||
/**
|
||||
* fabos.inc.php
|
||||
* Quanta.php
|
||||
*
|
||||
* LibreNMS processor discovery module for fabos
|
||||
* Netgear Quanta OS
|
||||
*
|
||||
* 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
|
||||
@ -19,11 +19,17 @@
|
||||
*
|
||||
* @package LibreNMS
|
||||
* @link http://librenms.org
|
||||
* @copyright 2017 Neil Lathwood
|
||||
* @author Neil Lathwood <neil@lathwood.co.uk>
|
||||
* @copyright 2017 Tony Murray
|
||||
* @author Tony Murray <murraytony@gmail.com>
|
||||
*/
|
||||
|
||||
if ($device['os'] === 'fabos') {
|
||||
$usage = snmp_get($device, 'swCpuUsage.0', '-Ovq', 'SW-MIB');
|
||||
discover_processor($valid['processor'], $device, '.1.3.6.1.4.1.1588.2.1.1.1.26.1.0', '1', 'fabos', 'Processor', '1', $usage);
|
||||
namespace LibreNMS\OS;
|
||||
|
||||
use LibreNMS\Interfaces\Discovery\ProcessorDiscovery;
|
||||
use LibreNMS\Interfaces\Polling\ProcessorPolling;
|
||||
use LibreNMS\OS;
|
||||
|
||||
class Quanta extends OS implements ProcessorDiscovery, ProcessorPolling
|
||||
{
|
||||
use OS\Traits\VxworksProcessorUsage;
|
||||
}
|
@ -25,7 +25,9 @@
|
||||
|
||||
namespace LibreNMS\OS;
|
||||
|
||||
use LibreNMS\Device\Processor;
|
||||
use LibreNMS\Device\WirelessSensor;
|
||||
use LibreNMS\Interfaces\Discovery\ProcessorDiscovery;
|
||||
use LibreNMS\Interfaces\Discovery\Sensors\WirelessFrequencyDiscovery;
|
||||
use LibreNMS\Interfaces\Discovery\Sensors\WirelessPowerDiscovery;
|
||||
use LibreNMS\Interfaces\Discovery\Sensors\WirelessRssiDiscovery;
|
||||
@ -33,11 +35,31 @@ use LibreNMS\Interfaces\Discovery\Sensors\WirelessSnrDiscovery;
|
||||
use LibreNMS\OS;
|
||||
|
||||
class Ray extends OS implements
|
||||
ProcessorDiscovery,
|
||||
WirelessFrequencyDiscovery,
|
||||
WirelessPowerDiscovery,
|
||||
WirelessRssiDiscovery,
|
||||
WirelessSnrDiscovery
|
||||
{
|
||||
/**
|
||||
* Discover processors.
|
||||
* Returns an array of LibreNMS\Device\Processor objects that have been discovered
|
||||
*
|
||||
* @return array Processors
|
||||
*/
|
||||
public function discoverProcessors()
|
||||
{
|
||||
// RAY-MIB::useCpu has no index, so it won't work in yaml
|
||||
|
||||
return array(
|
||||
Processor::discover(
|
||||
$this->getName(),
|
||||
$this->getDeviceId(),
|
||||
'.1.3.6.1.4.1.33555.1.1.5.1',
|
||||
0
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Discover wireless frequency. This is in GHz. Type is frequency.
|
||||
|
33
LibreNMS/OS/Serveriron.php
Normal file
33
LibreNMS/OS/Serveriron.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* Serveriron.php
|
||||
*
|
||||
* Brocade ServerIron OS
|
||||
*
|
||||
* 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 2018 Tony Murray
|
||||
* @author Tony Murray <murraytony@gmail.com>
|
||||
*/
|
||||
|
||||
namespace LibreNMS\OS;
|
||||
|
||||
use LibreNMS\OS\Shared\Foundry;
|
||||
|
||||
class Serveriron extends Foundry
|
||||
{
|
||||
|
||||
}
|
63
LibreNMS/OS/Sgos.php
Normal file
63
LibreNMS/OS/Sgos.php
Normal file
@ -0,0 +1,63 @@
|
||||
<?php
|
||||
/**
|
||||
* Sgos.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 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 Sgos extends OS implements ProcessorDiscovery
|
||||
{
|
||||
/**
|
||||
* Discover processors.
|
||||
* Returns an array of LibreNMS\Device\Processor objects that have been discovered
|
||||
*
|
||||
* @return array Processors
|
||||
*/
|
||||
public function discoverProcessors()
|
||||
{
|
||||
$data = snmpwalk_group($this->getDevice(), 'sgProxyCpuCoreBusyPerCent', 'BLUECOAT-SG-PROXY-MIB');
|
||||
|
||||
$processors = array();
|
||||
$count = 1;
|
||||
foreach ($data as $index => $entry) {
|
||||
$processors[] = Processor::discover(
|
||||
$this->getName(),
|
||||
$this->getDeviceId(),
|
||||
".1.3.6.1.4.1.3417.2.11.2.4.1.8.$index",
|
||||
zeropad($index),
|
||||
"Processor $count",
|
||||
1,
|
||||
$entry['s5ChasUtilCPUUsageLast10Minutes']
|
||||
);
|
||||
|
||||
$count++;
|
||||
}
|
||||
|
||||
|
||||
return $processors;
|
||||
}
|
||||
}
|
98
LibreNMS/OS/Shared/Cisco.php
Normal file
98
LibreNMS/OS/Shared/Cisco.php
Normal file
@ -0,0 +1,98 @@
|
||||
<?php
|
||||
/**
|
||||
* Cisco.php
|
||||
*
|
||||
* Base Cisco OS for Cisco based devices
|
||||
*
|
||||
* 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 2018 Tony Murray
|
||||
* @author Tony Murray <murraytony@gmail.com>
|
||||
*/
|
||||
|
||||
namespace LibreNMS\OS\Shared;
|
||||
|
||||
use LibreNMS\Device\Processor;
|
||||
use LibreNMS\Interfaces\Discovery\ProcessorDiscovery;
|
||||
use LibreNMS\OS;
|
||||
|
||||
class Cisco extends OS implements ProcessorDiscovery
|
||||
{
|
||||
/**
|
||||
* Discover processors.
|
||||
* Returns an array of LibreNMS\Device\Processor objects that have been discovered
|
||||
*
|
||||
* @return array Processors
|
||||
*/
|
||||
public function discoverProcessors()
|
||||
{
|
||||
$processors_data = snmpwalk_group($this->getDevice(), 'cpmCPU', 'CISCO-PROCESS-MIB');
|
||||
$processors = array();
|
||||
|
||||
foreach ($processors_data as $index => $entry) {
|
||||
if (is_numeric($entry['cpmCPUTotal5minRev'])) {
|
||||
$usage_oid = '.1.3.6.1.4.1.9.9.109.1.1.1.1.8.'.$index;
|
||||
$usage = $entry['cpmCPUTotal5minRev'];
|
||||
} elseif (is_numeric($entry['cpmCPUTotal5min'])) {
|
||||
$usage_oid = '.1.3.6.1.4.1.9.9.109.1.1.1.1.5.'.$index;
|
||||
$usage = $entry['cpmCPUTotal5min'];
|
||||
} else {
|
||||
continue; // skip bad data
|
||||
}
|
||||
|
||||
$entPhysicalIndex = $entry['cpmCPUTotalPhysicalIndex'];
|
||||
|
||||
if ($entPhysicalIndex) {
|
||||
if ($this->isCached('entPhysicalName')) {
|
||||
$entPhysicalName_array = $this->getCacheByIndex('entPhysicalName', 'ENTITY-MIB');
|
||||
$descr = $entPhysicalName_array[$entPhysicalIndex];
|
||||
}
|
||||
|
||||
if (empty($descr)) {
|
||||
$descr = snmp_get($this->getDevice(), 'entPhysicalName.'.$entPhysicalIndex, '-Oqv', 'ENTITY-MIB');
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($descr)) {
|
||||
$descr = "Processor $index";
|
||||
}
|
||||
|
||||
$processors[] = Processor::discover(
|
||||
'cpm',
|
||||
$this->getDeviceId(),
|
||||
$usage_oid,
|
||||
$index,
|
||||
$descr,
|
||||
1,
|
||||
$usage,
|
||||
null,
|
||||
$entPhysicalIndex
|
||||
);
|
||||
}
|
||||
|
||||
if (empty($processors)) {
|
||||
// fallback to old pre-12.0 OID
|
||||
$processors[] = Processor::discover(
|
||||
'ios',
|
||||
$this->getDeviceId(),
|
||||
'.1.3.6.1.4.1.9.2.1.58.0', // OLD-CISCO-CPU-MIB::avgBusy5
|
||||
0
|
||||
);
|
||||
}
|
||||
|
||||
return $processors;
|
||||
}
|
||||
}
|
81
LibreNMS/OS/Shared/Foundry.php
Normal file
81
LibreNMS/OS/Shared/Foundry.php
Normal file
@ -0,0 +1,81 @@
|
||||
<?php
|
||||
/**
|
||||
* Foundry.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 2018 Tony Murray
|
||||
* @author Tony Murray <murraytony@gmail.com>
|
||||
*/
|
||||
|
||||
namespace LibreNMS\OS\Shared;
|
||||
|
||||
use LibreNMS\Device\Processor;
|
||||
use LibreNMS\Interfaces\Discovery\ProcessorDiscovery;
|
||||
use LibreNMS\OS;
|
||||
|
||||
class Foundry extends OS implements ProcessorDiscovery
|
||||
{
|
||||
/**
|
||||
* Discover processors.
|
||||
* Returns an array of LibreNMS\Device\Processor objects that have been discovered
|
||||
*
|
||||
* @return array Processors
|
||||
*/
|
||||
public function discoverProcessors()
|
||||
{
|
||||
$processors_data = snmpwalk_cache_triple_oid($this->getDevice(), 'snAgentCpuUtilTable', array(), 'FOUNDRY-SN-AGENT-MIB');
|
||||
$module_descriptions = $this->getCacheByIndex('snAgentConfigModuleDescription', 'FOUNDRY-SN-AGENT-MIB');
|
||||
|
||||
$processors = array();
|
||||
foreach ($processors_data as $index => $entry) {
|
||||
// use the 5 minute readings
|
||||
if ($entry['snAgentCpuUtilInterval'] != 300) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (is_numeric($entry['snAgentCpuUtil100thPercent'])) {
|
||||
$usage_oid = '.1.3.6.1.4.1.1991.1.1.2.11.1.1.6.' . $index;
|
||||
$precision = 100;
|
||||
$usage = $entry['snAgentCpuUtil100thPercent'] / $precision;
|
||||
} elseif (is_numeric($entry['snAgentCpuUtilValue'])) {
|
||||
$usage_oid = '.1.3.6.1.4.1.1991.1.1.2.11.1.1.4.' . $index;
|
||||
$precision = 1;
|
||||
$usage = $entry['snAgentCpuUtilValue'] / $precision;
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
|
||||
$module_description = $module_descriptions[$entry['snAgentCpuUtilSlotNum']];
|
||||
list($module_description) = explode(' ', $module_description);
|
||||
$descr = "Slot {$entry['snAgentCpuUtilSlotNum']} $module_description [{$entry['snAgentCpuUtilSlotNum']}]";
|
||||
|
||||
$processors[] = Processor::discover(
|
||||
$this->getName(),
|
||||
$this->getDeviceId(),
|
||||
$usage_oid,
|
||||
$index,
|
||||
$descr,
|
||||
$precision,
|
||||
$usage
|
||||
);
|
||||
}
|
||||
|
||||
return $processors;
|
||||
}
|
||||
}
|
64
LibreNMS/OS/Terra.php
Normal file
64
LibreNMS/OS/Terra.php
Normal file
@ -0,0 +1,64 @@
|
||||
<?php
|
||||
/**
|
||||
* Terra.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 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 Terra extends OS implements ProcessorDiscovery
|
||||
{
|
||||
/**
|
||||
* Discover processors.
|
||||
* Returns an array of LibreNMS\Device\Processor objects that have been discovered
|
||||
*
|
||||
* @return array Processors
|
||||
*/
|
||||
public function discoverProcessors()
|
||||
{
|
||||
$device = $this->getDevice();
|
||||
|
||||
$query = array(
|
||||
"sti410C" => ".1.3.6.1.4.1.30631.1.9.1.1.3.0",
|
||||
"sti440" => ".1.3.6.1.4.1.30631.1.18.1.326.3.0"
|
||||
);
|
||||
|
||||
foreach ($query as $decr => $oid) {
|
||||
if (strpos($device["sysDescr"], $decr) !== false) {
|
||||
return array(
|
||||
Processor::discover(
|
||||
'cpu',
|
||||
$this->getDeviceId(),
|
||||
$oid,
|
||||
0
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return array();
|
||||
}
|
||||
}
|
@ -1,8 +1,8 @@
|
||||
<?php
|
||||
/**
|
||||
* fortiswitch.inc.php
|
||||
* FrogfootResources.php
|
||||
*
|
||||
* LibreNMS processor discovery module for FortiSwitch
|
||||
* A trait to add FROGFOOT-RESOURCES-MIB support to an OS
|
||||
*
|
||||
* 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
|
||||
@ -19,18 +19,31 @@
|
||||
*
|
||||
* @package LibreNMS
|
||||
* @link http://librenms.org
|
||||
* @copyright 2016 Neil Lathwood
|
||||
* @author Neil Lathwood <neil@lathwood.co.uk>
|
||||
* @copyright 2018 Tony Murray
|
||||
* @author Tony Murray <murraytony@gmail.com>
|
||||
*/
|
||||
|
||||
if ($device['os'] === 'fortiswitch') {
|
||||
echo 'Fortiswitch : ';
|
||||
$descr = 'Processor';
|
||||
$usage = snmp_get($device, 'fsSysCpuUsage.0', '-Ovq', 'FORTINET-FORTISWITCH-MIB');
|
||||
namespace LibreNMS\OS\Traits;
|
||||
|
||||
if (is_numeric($usage)) {
|
||||
discover_processor($valid['processor'], $device, '.1.3.6.1.4.1.12356.106.4.1.2.0', '1', 'fortiswitch', $descr, '1', $usage, null, null);
|
||||
use LibreNMS\Device\Processor;
|
||||
|
||||
trait FrogfootResources
|
||||
{
|
||||
/**
|
||||
* Discover processors.
|
||||
* Returns an array of LibreNMS\Device\Processor objects that have been discovered
|
||||
*
|
||||
* @return array Processors
|
||||
*/
|
||||
public function discoverProcessors()
|
||||
{
|
||||
return array(
|
||||
Processor::discover(
|
||||
$this->getName(),
|
||||
$this->getDeviceID(),
|
||||
'1.3.6.1.4.1.10002.1.1.1.4.2.1.3.2',
|
||||
0
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
unset($usage);
|
111
LibreNMS/OS/Traits/HostResources.php
Normal file
111
LibreNMS/OS/Traits/HostResources.php
Normal file
@ -0,0 +1,111 @@
|
||||
<?php
|
||||
/**
|
||||
* HostResources.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 2018 Tony Murray
|
||||
* @author Tony Murray <murraytony@gmail.com>
|
||||
*/
|
||||
|
||||
namespace LibreNMS\OS\Traits;
|
||||
|
||||
use LibreNMS\Device\Processor;
|
||||
|
||||
trait HostResources
|
||||
{
|
||||
/**
|
||||
* Discover processors.
|
||||
* Returns an array of LibreNMS\Device\Processor objects that have been discovered
|
||||
*
|
||||
* @return array Processors
|
||||
*/
|
||||
public function discoverProcessors()
|
||||
{
|
||||
echo "Host Resources: ";
|
||||
$processors = array();
|
||||
|
||||
try {
|
||||
$hrProcessorLoad = $this->getCacheByIndex('hrProcessorLoad', 'HOST-RESOURCES-MIB');
|
||||
|
||||
if (empty($hrProcessorLoad)) {
|
||||
// no hr data, return
|
||||
return array();
|
||||
}
|
||||
|
||||
$hrDeviceDescr = $this->getCacheByIndex('hrDeviceDescr', 'HOST-RESOURCES-MIB');
|
||||
} catch (\Exception $e) {
|
||||
return array();
|
||||
}
|
||||
|
||||
foreach ($hrProcessorLoad as $index => $usage) {
|
||||
$usage_oid = '.1.3.6.1.2.1.25.3.3.1.2.' . $index;
|
||||
$descr = $hrDeviceDescr[$index];
|
||||
|
||||
if (!is_numeric($usage)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$device = $this->getDevice();
|
||||
if ($device['os'] == 'arista-eos' && $index == '1') {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (empty($descr)
|
||||
|| $descr == 'Unknown Processor Type' // Windows: Unknown Processor Type
|
||||
|| $descr == 'An electronic chip that makes the computer work.'
|
||||
) {
|
||||
$descr = 'Processor';
|
||||
} else {
|
||||
// Make the description a bit shorter
|
||||
$remove_strings = array(
|
||||
'GenuineIntel: ',
|
||||
'AuthenticAMD: ',
|
||||
'CPU ',
|
||||
'(TM)',
|
||||
'(R)',
|
||||
);
|
||||
$descr = str_replace($remove_strings, '', $descr);
|
||||
$descr = str_replace(' ', ' ', $descr);
|
||||
}
|
||||
|
||||
$old_name = array('hrProcessor', $index);
|
||||
$new_name = array('processor', 'hr', $index);
|
||||
rrd_file_rename($this->getDevice(), $old_name, $new_name);
|
||||
|
||||
$processor = Processor::discover(
|
||||
'hr',
|
||||
$this->getDeviceId(),
|
||||
$usage_oid,
|
||||
$index,
|
||||
$descr,
|
||||
1,
|
||||
$usage,
|
||||
null,
|
||||
null,
|
||||
$index
|
||||
);
|
||||
|
||||
if ($processor->isValid()) {
|
||||
$processors[] = $processor;
|
||||
}
|
||||
}
|
||||
|
||||
return $processors;
|
||||
}
|
||||
}
|
@ -1,8 +1,8 @@
|
||||
<?php
|
||||
/**
|
||||
* saf-integra.inc.php
|
||||
* UcdProcessor.php
|
||||
*
|
||||
* LibreNMS processor discovery module for Saf Integra
|
||||
* -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
|
||||
@ -19,25 +19,34 @@
|
||||
*
|
||||
* @package LibreNMS
|
||||
* @link http://librenms.org
|
||||
* @copyright 2017 Neil Lathwood
|
||||
* @author Neil Lathwood <neil@lathwood.co.uk>
|
||||
* @copyright 2018 Tony Murray
|
||||
* @author Tony Murray <murraytony@gmail.com>
|
||||
*/
|
||||
|
||||
if ($device['os'] === 'saf-integra') {
|
||||
echo 'Saf Integra : ';
|
||||
namespace LibreNMS\OS\Traits;
|
||||
|
||||
$oid = '.1.3.6.1.4.1.7571.100.1.1.7.2.4.10.0';
|
||||
$descr = 'Processor';
|
||||
$usage = snmp_get($device, $oid, '-Ovqn');
|
||||
use LibreNMS\Device\Processor;
|
||||
|
||||
if (is_numeric($usage)) {
|
||||
$usage = 100 - ($usage / 10);
|
||||
discover_processor($valid['processor'], $device, $oid, '0', 'saf-integra', $descr, '1', $usage);
|
||||
trait UcdResources
|
||||
{
|
||||
/**
|
||||
* Discover processors.
|
||||
* Returns an array of LibreNMS\Device\Processor objects that have been discovered
|
||||
*
|
||||
* @return array Processors
|
||||
*/
|
||||
public function discoverProcessors()
|
||||
{
|
||||
echo "UCD Resources: ";
|
||||
return array(
|
||||
Processor::discover(
|
||||
'ucd-old',
|
||||
$this->getDeviceId(),
|
||||
'.1.3.6.1.4.1.2021.11.11.0',
|
||||
0,
|
||||
'CPU',
|
||||
-1
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
unset(
|
||||
$oid,
|
||||
$descr,
|
||||
$usage
|
||||
);
|
91
LibreNMS/OS/Traits/VxworksProcessorUsage.php
Normal file
91
LibreNMS/OS/Traits/VxworksProcessorUsage.php
Normal file
@ -0,0 +1,91 @@
|
||||
<?php
|
||||
/**
|
||||
* VxworksProcessorUsage.php
|
||||
*
|
||||
* Several devices use the janky output of this oid
|
||||
* Requires both ProcessorDiscovery and ProcessorPolling
|
||||
*
|
||||
* 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 2018 Tony Murray
|
||||
* @author Tony Murray <murraytony@gmail.com>
|
||||
*/
|
||||
|
||||
namespace LibreNMS\OS\Traits;
|
||||
|
||||
use LibreNMS\Device\Processor;
|
||||
|
||||
trait VxworksProcessorUsage
|
||||
{
|
||||
/**
|
||||
* Discover processors.
|
||||
* Returns an array of LibreNMS\Device\Processor objects that have been discovered
|
||||
*
|
||||
* @param string $oid Custom OID to fetch from
|
||||
* @return array Processors
|
||||
*/
|
||||
public function discoverProcessors($oid = '.1.3.6.1.4.1.4413.1.1.1.1.4.9.0')
|
||||
{
|
||||
$usage = $this->parseCpuUsage(snmp_get($this->getDevice(), $oid, '-Ovq'));
|
||||
if (is_numeric($usage)) {
|
||||
return array(
|
||||
Processor::discover(
|
||||
$this->getName(),
|
||||
$this->getDeviceId(),
|
||||
$oid,
|
||||
0,
|
||||
'Processor',
|
||||
1,
|
||||
$usage
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
$data = array();
|
||||
|
||||
foreach ($processors as $processor) {
|
||||
$data[$processor['processor_id']] = $this->parseCpuUsage(
|
||||
snmp_get($this->getDevice(), $processor['processor_oid'])
|
||||
);
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse the silly cpu usage string
|
||||
* " 5 Secs ( 96.4918%) 60 Secs ( 54.2271%) 300 Secs ( 38.2591%)"
|
||||
*
|
||||
* @param $data
|
||||
* @return mixed
|
||||
*/
|
||||
private function parseCpuUsage($data)
|
||||
{
|
||||
preg_match('/([0-9]+.[0-9]+)%/', $data, $matches);
|
||||
return $matches[1];
|
||||
}
|
||||
}
|
@ -26,6 +26,7 @@
|
||||
namespace LibreNMS\OS;
|
||||
|
||||
use LibreNMS\Device\WirelessSensor;
|
||||
use LibreNMS\Interfaces\Discovery\ProcessorDiscovery;
|
||||
use LibreNMS\Interfaces\Discovery\Sensors\WirelessCcqDiscovery;
|
||||
use LibreNMS\Interfaces\Discovery\Sensors\WirelessClientsDiscovery;
|
||||
use LibreNMS\Interfaces\Discovery\Sensors\WirelessFrequencyDiscovery;
|
||||
@ -36,6 +37,7 @@ use LibreNMS\Interfaces\Polling\Sensors\WirelessFrequencyPolling;
|
||||
use LibreNMS\OS;
|
||||
|
||||
class Unifi extends OS implements
|
||||
ProcessorDiscovery,
|
||||
WirelessClientsDiscovery,
|
||||
WirelessCcqDiscovery,
|
||||
WirelessCcqPolling,
|
||||
@ -44,6 +46,8 @@ class Unifi extends OS implements
|
||||
WirelessPowerDiscovery,
|
||||
WirelessUtilizationDiscovery
|
||||
{
|
||||
use OS\Traits\FrogfootResources;
|
||||
|
||||
private $ccqDivisor = 10;
|
||||
|
||||
/**
|
||||
|
80
LibreNMS/OS/Vrp.php
Normal file
80
LibreNMS/OS/Vrp.php
Normal file
@ -0,0 +1,80 @@
|
||||
<?php
|
||||
/**
|
||||
* Vrp.php
|
||||
*
|
||||
* Huawei VRP
|
||||
*
|
||||
* 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 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 Vrp extends OS implements ProcessorDiscovery
|
||||
{
|
||||
/**
|
||||
* Discover processors.
|
||||
* Returns an array of LibreNMS\Device\Processor objects that have been discovered
|
||||
*
|
||||
* @return array Processors
|
||||
*/
|
||||
public function discoverProcessors()
|
||||
{
|
||||
$device = $this->getDevice();
|
||||
|
||||
$processors_data = snmpwalk_cache_multi_oid($device, 'hwEntityCpuUsage', array(), 'HUAWEI-ENTITY-EXTENT-MIB', 'huawei');
|
||||
|
||||
if (!empty($processors_data)) {
|
||||
$processors_data = snmpwalk_cache_multi_oid($device, 'hwEntityMemSize', $processors_data, 'HUAWEI-ENTITY-EXTENT-MIB', 'huawei');
|
||||
$processors_data = snmpwalk_cache_multi_oid($device, 'hwEntityBomEnDesc', $processors_data, 'HUAWEI-ENTITY-EXTENT-MIB', 'huawei');
|
||||
}
|
||||
|
||||
d_echo($processors_data);
|
||||
|
||||
$processors = array();
|
||||
foreach ($processors_data as $index => $entry) {
|
||||
if ($entry['hwEntityMemSize'] != 0) {
|
||||
d_echo($index.' '.$entry['hwEntityBomEnDesc'].' -> '.$entry['hwEntityCpuUsage'].' -> '.$entry['hwEntityMemSize']."\n");
|
||||
|
||||
$usage_oid = '.1.3.6.1.4.1.2011.5.25.31.1.1.1.1.5.'.$index;
|
||||
$descr = $entry['hwEntityBomEnDesc'];
|
||||
$usage = $entry['hwEntityCpuUsage'];
|
||||
|
||||
if (empty($descr) || str_contains($descr, 'No') || str_contains($usage, 'No')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$processors[] = Processor::discover(
|
||||
$this->getName(),
|
||||
$this->getDeviceId(),
|
||||
$usage_oid,
|
||||
$index,
|
||||
$descr,
|
||||
1,
|
||||
$usage
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return $processors;
|
||||
}
|
||||
}
|
@ -26,6 +26,7 @@
|
||||
namespace LibreNMS\Util;
|
||||
|
||||
use LibreNMS\Config;
|
||||
use LibreNMS\Exceptions\FileNotFoundException;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
|
||||
class ModuleTestHelper
|
||||
@ -59,13 +60,15 @@ class ModuleTestHelper
|
||||
*/
|
||||
public function __construct($modules, $os, $variant = '')
|
||||
{
|
||||
global $influxdb;
|
||||
|
||||
$this->modules = $this->resolveModuleDependencies((array)$modules);
|
||||
$this->os = $os;
|
||||
$this->variant = $variant;
|
||||
$this->os = strtolower($os);
|
||||
$this->variant = strtolower($variant);
|
||||
|
||||
// preset the file names
|
||||
if ($variant) {
|
||||
$variant = '_' . $variant;
|
||||
$variant = '_' . $this->variant;
|
||||
}
|
||||
$install_dir = Config::get('install_dir');
|
||||
$this->file_name = $os . $variant;
|
||||
@ -76,7 +79,9 @@ class ModuleTestHelper
|
||||
|
||||
// never store time series data
|
||||
Config::set('norrd', true);
|
||||
Config::set('hide_rrd_disabled', true);
|
||||
Config::set('noinfluxdb', true);
|
||||
$influxdb = false;
|
||||
Config::set('nographite', true);
|
||||
|
||||
$this->module_tables = Yaml::parse($install_dir . '/tests/module_tables.yaml');
|
||||
@ -456,10 +461,23 @@ class ModuleTestHelper
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Run discovery and polling against snmpsim data and create a database dump
|
||||
* Save the dumped data to tests/data/<os>.json
|
||||
*
|
||||
* @param Snmpsim $snmpsim
|
||||
* @param bool $no_save
|
||||
* @return array
|
||||
* @throws FileNotFoundException
|
||||
*/
|
||||
public function generateTestData(Snmpsim $snmpsim, $no_save = false)
|
||||
{
|
||||
global $device, $debug, $vdebug;
|
||||
|
||||
if (!is_file($this->snmprec_file)) {
|
||||
throw new FileNotFoundException("$this->snmprec_file does not exist!");
|
||||
}
|
||||
|
||||
// Remove existing device in case it didn't get removed previously
|
||||
if ($existing_device = device_by_name($snmpsim->getIp())) {
|
||||
delete_device($existing_device['device_id']);
|
||||
@ -549,7 +567,7 @@ class ModuleTestHelper
|
||||
}
|
||||
}
|
||||
|
||||
file_put_contents($this->json_file, _json_encode($existing_data));
|
||||
file_put_contents($this->json_file, _json_encode($existing_data) . PHP_EOL);
|
||||
$this->qPrint("Saved to $this->json_file\nReady for testing!\n");
|
||||
}
|
||||
|
||||
|
@ -41,35 +41,83 @@ if (is_numeric($perc)) {
|
||||
|
||||
#### Processor
|
||||
|
||||
Detection for processors is done via a single script unless custom processing of data is required (as in this example).
|
||||
Detection for processors is done via a yaml file unless custom processing of data is required.
|
||||
|
||||
`includes/discovery/processors/pulse.inc.php`
|
||||
##### YAML
|
||||
|
||||
`includes/definitions/discovery/pulse.yaml`
|
||||
|
||||
```yaml
|
||||
mib: PULSESECURE-PSG-MIB
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
-
|
||||
oid: iveCpuUtil
|
||||
num_oid: '.1.3.6.1.4.1.12532.10.{{ $index }}'
|
||||
type: pulse
|
||||
```
|
||||
|
||||
Available yaml data keys:
|
||||
|
||||
Key | Default | Description
|
||||
----- | --- | -----
|
||||
oid | required | The string based oid to fetch data, could be a table or a single value
|
||||
num_oid | required | the numerical oid to fetch data from when polling, usually should be appended by {{ $index }}
|
||||
value | optional | Oid to retrieve data from, primarily used for tables
|
||||
precision | 1 | The multiplier to multiply the data by. If this is negative, the data will be multiplied then subtracted from 100.
|
||||
descr | Processor | Description of this processor, may be an oid or plain string. Helpful values {{ $index }} and {{$count}}
|
||||
type | <os name> | Name of this sensor. This is used with the index to generate a unique id for this sensor.
|
||||
index | {{ $index }} | The index of this sensor, defaults to the index of the oid.
|
||||
skip_values | optional | Do not detect this sensor if the value matches
|
||||
|
||||
Accessing values within yaml:
|
||||
|
||||
| | |
|
||||
| --- | --- |
|
||||
| {{ $index }} | The index after the given oid |
|
||||
| {{ $count }} | The count of entries (starting with 1) |
|
||||
| {{ $`oid` }} | Any oid in the table or pre-fetched |
|
||||
|
||||
|
||||
##### Custom Discovery and Polling
|
||||
|
||||
If you need to implement custom discovery or polling you can implement the ProcessorDiscovery interface and
|
||||
the ProcessorPolling interface in the OS class.
|
||||
|
||||
OS Class files reside under `LibreNMS\OS`
|
||||
|
||||
```php
|
||||
<?php
|
||||
namespace LibreNMS\OS;
|
||||
|
||||
if ($device['os'] === 'pulse') {
|
||||
echo 'Pulse Secure : ';
|
||||
use LibreNMS\Device\Processor;
|
||||
use LibreNMS\Interfaces\Discovery\ProcessorDiscovery;
|
||||
use LibreNMS\Interfaces\Polling\ProcessorPolling;
|
||||
use LibreNMS\OS;
|
||||
|
||||
$descr = 'Processor';
|
||||
$usage = str_replace('"', "", snmp_get($device, 'iveCpuUtil.0', '-OvQ', 'PULSESECURE-PSG-MIB'));
|
||||
class ExampleOS extends OS implements ProcessorDiscovery, ProcessorPolling
|
||||
{
|
||||
/**
|
||||
* Discover processors.
|
||||
* Returns an array of LibreNMS\Device\Processor objects that have been discovered
|
||||
*
|
||||
* @return array Processors
|
||||
*/
|
||||
public function discoverProcessors()
|
||||
{
|
||||
// discovery code here
|
||||
}
|
||||
|
||||
if (is_numeric($usage)) {
|
||||
discover_processor($valid['processor'], $device, 'iveCpuUtil.0', '0', 'pulse-cpu', $descr, '100', $usage, null, null);
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
// polling code here
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
`includes/polling/processors/pulse.inc.php`
|
||||
|
||||
```php
|
||||
<?php
|
||||
|
||||
echo 'Pulse Secure CPU Usage';
|
||||
|
||||
$usage = str_replace('"', "", snmp_get($device, 'iveCpuUtil.0', '-OvQ', 'PULSESECURE-PSG-MIB'));
|
||||
|
||||
if (is_numeric($usage)) {
|
||||
$proc = ($usage * 100);
|
||||
}
|
||||
```
|
||||
|
@ -1,5 +1,5 @@
|
||||
os: aos
|
||||
group: aos
|
||||
group: nokia
|
||||
text: 'Alcatel-Lucent OS'
|
||||
type: network
|
||||
ifXmcbc: 1
|
||||
|
@ -1,9 +1,10 @@
|
||||
os: apex-lynx
|
||||
text: 'Apex Lynx'
|
||||
type: wireless
|
||||
icon: trango
|
||||
over:
|
||||
- { graph: device_bits, text: 'Device Traffic' }
|
||||
discovery:
|
||||
- sysDescr_regex: '/^Apex Lynx/'
|
||||
mib_dir: trango
|
||||
os: apex-lynx
|
||||
text: 'Apex Lynx'
|
||||
type: wireless
|
||||
icon: trango
|
||||
mib_dir:
|
||||
- trango
|
||||
over:
|
||||
- { graph: device_bits, text: 'Device Traffic' }
|
||||
discovery:
|
||||
- sysDescr_regex: '/^Apex Lynx/'
|
||||
|
@ -2,6 +2,8 @@ os: binos
|
||||
text: 'Telco Systems BiNOS'
|
||||
type: network
|
||||
icon: telco-systems
|
||||
mib_dir:
|
||||
- telco-systems/binos
|
||||
over:
|
||||
- { graph: device_bits, text: 'Device Traffic' }
|
||||
- { graph: device_processor, text: 'CPU Usage' }
|
||||
|
@ -2,10 +2,12 @@ os: binox
|
||||
text: 'Telco Systems BiNOX'
|
||||
type: network
|
||||
icon: telco-systems
|
||||
mib_dir:
|
||||
- telco-systems/binox
|
||||
over:
|
||||
- { graph: device_bits, text: 'Device Traffic' }
|
||||
- { graph: device_processor, text: 'CPU Usage' }
|
||||
- { graph: device_mempool, text: 'Memory Usage' }
|
||||
discovery:
|
||||
- sysObjectID:
|
||||
- .1.3.6.1.4.1.738.10.5.100
|
||||
- .1.3.6.1.4.1.738.10.5.
|
||||
|
@ -1,9 +1,10 @@
|
||||
os: ciscosb
|
||||
group: cisco
|
||||
text: 'Cisco Small Business'
|
||||
ifname: 1
|
||||
type: network
|
||||
icon: cisco
|
||||
mib_dir:
|
||||
- cisco
|
||||
over:
|
||||
- { graph: device_bits, text: 'Device Traffic' }
|
||||
- { graph: device_processor, text: 'CPU Usage' }
|
||||
@ -52,4 +53,4 @@ discovery:
|
||||
- .1.3.6.1.4.1.9.6.1.98
|
||||
- .1.3.6.1.4.1.3955.6.
|
||||
- sysDescr_regex:
|
||||
- '/^Linksys SLM/'
|
||||
- '/^Linksys SLM/'
|
||||
|
@ -2,10 +2,9 @@ os: cmm
|
||||
text: Cambium CMM
|
||||
type: wireless
|
||||
icon: cambium
|
||||
mib_dir: cambium
|
||||
group: cambium
|
||||
over:
|
||||
- { graph: device_bits, text: 'Device Traffic' }
|
||||
group: cambium
|
||||
discovery:
|
||||
-
|
||||
sysObjectID:
|
||||
@ -17,4 +16,4 @@ discovery:
|
||||
- '/CMM/i'
|
||||
snmpget:
|
||||
oid: .1.3.6.1.4.1.161.19.3.4.4.2.0
|
||||
value: CMM
|
||||
value: CMM
|
||||
|
@ -2,11 +2,12 @@ os: cnpilote
|
||||
text: Cambium cnPilot
|
||||
type: wireless
|
||||
icon: cambium
|
||||
mib_dir: cambium\cnpilote
|
||||
group: cambium
|
||||
mib_dir:
|
||||
- cambium/cnpilote
|
||||
over:
|
||||
- { graph: device_bits, text: 'Device Traffic' }
|
||||
- { graph: device_wireless_clients, text: 'Number of Clients' }
|
||||
group: cambium
|
||||
discovery:
|
||||
- sysObjectID:
|
||||
- .1.3.6.1.4.1.17713.22
|
||||
|
@ -2,11 +2,12 @@ os: cnpilotr
|
||||
text: Cambium cnPilot Router
|
||||
type: network
|
||||
icon: cambium
|
||||
mib_dir: cambium\cnpilotr
|
||||
group: cambium
|
||||
mib_dir:
|
||||
- cambium/cnpilotr
|
||||
over:
|
||||
- { graph: device_bits, text: 'Device Traffic' }
|
||||
group: cambium
|
||||
discovery:
|
||||
-
|
||||
sysDescr_regex:
|
||||
- '/(cnPilot R[0-9][0-9][0-9])/i'
|
||||
- '/(cnPilot R[0-9][0-9][0-9])/i'
|
||||
|
8
includes/definitions/discovery/3com.yaml
Normal file
8
includes/definitions/discovery/3com.yaml
Normal file
@ -0,0 +1,8 @@
|
||||
mib: A3COM-HUAWEI-LswDEVM-MIB
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
-
|
||||
oid: hwCpuCostRatePer1Min
|
||||
num_oid: '.1.3.6.1.4.1.43.45.1.6.1.1.1.3.{{ $index }}'
|
||||
index: 0
|
@ -1,5 +1,11 @@
|
||||
mib: mibs/a10/A10-AX-MIB
|
||||
mib: A10-AX-MIB
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
-
|
||||
oid: axSysCpuUsageValue
|
||||
num_oid: '.1.3.6.1.4.1.22610.2.4.1.3.2.1.3.{{ $index }}'
|
||||
descr: 'Proc #{{ $index }}'
|
||||
sensors:
|
||||
state:
|
||||
data:
|
||||
@ -85,4 +91,4 @@ modules:
|
||||
oid: axSysHwPhySystemTemp
|
||||
num_oid: .1.3.6.1.4.1.22610.2.4.1.5.1.
|
||||
descr: System Temp
|
||||
index: 'axSysHwPhySystemTemp.{{ $index }}'
|
||||
index: 'axSysHwPhySystemTemp.{{ $index }}'
|
||||
|
7
includes/definitions/discovery/adtran-aos.yaml
Normal file
7
includes/definitions/discovery/adtran-aos.yaml
Normal file
@ -0,0 +1,7 @@
|
||||
mib: ADTRAN-AOSCPU
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
-
|
||||
oid: adGenAOSCurrentCpuUtil
|
||||
num_oid: '.1.3.6.1.4.1.664.5.53.1.4.1.{{ $index }}'
|
7
includes/definitions/discovery/alteonos.yaml
Normal file
7
includes/definitions/discovery/alteonos.yaml
Normal file
@ -0,0 +1,7 @@
|
||||
mib: ALTEON-CHEETAH-SWITCH-MIB
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
-
|
||||
oid: mpCpuStatsUtil1Second
|
||||
num_oid: '.1.3.6.1.4.1.1872.2.5.1.2.2.1.{{ $index }}'
|
@ -1,5 +1,10 @@
|
||||
mib: RADWARE-MIB
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
-
|
||||
oid: rsWSDRSResourceUtilization
|
||||
num_oid: '.1.3.6.1.4.1.89.35.1.54.{{ $index }}'
|
||||
sensors:
|
||||
temperature:
|
||||
data:
|
||||
|
8
includes/definitions/discovery/avaya-vsp.yaml
Normal file
8
includes/definitions/discovery/avaya-vsp.yaml
Normal file
@ -0,0 +1,8 @@
|
||||
mib: RAPID-CITY
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
-
|
||||
oid: rcKhiSlotCpu5MinAve
|
||||
num_oid: '.1.3.6.1.4.1.2272.1.85.10.1.1.3.{{ $index }}'
|
||||
descr: VSP Processor
|
8
includes/definitions/discovery/bdcom.yaml
Normal file
8
includes/definitions/discovery/bdcom.yaml
Normal file
@ -0,0 +1,8 @@
|
||||
mib: NMS-PROCESS-MIB
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
-
|
||||
oid: nmspmCPUTotal5min
|
||||
num_oid: '.1.3.6.1.4.1.3320.9.109.1.1.1.1.5.{{ $index }}'
|
||||
index: 0
|
8
includes/definitions/discovery/benuos.yaml
Normal file
8
includes/definitions/discovery/benuos.yaml
Normal file
@ -0,0 +1,8 @@
|
||||
mib: BENU-HOST-MIB
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
-
|
||||
oid: bSysAvgCPUUtil5Min
|
||||
num_oid: '.1.3.6.1.4.1.39406.1.5.1.8.{{ $index }}'
|
||||
index: 1
|
7
includes/definitions/discovery/binos.yaml
Normal file
7
includes/definitions/discovery/binos.yaml
Normal file
@ -0,0 +1,7 @@
|
||||
mib: PRVT-SYS-MON-MIB
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
-
|
||||
oid: monCpuUtilization
|
||||
num_oid: '.1.3.6.1.4.1.738.1.111.3.1.2.1.{{ $index }}'
|
10
includes/definitions/discovery/binox.yaml
Normal file
10
includes/definitions/discovery/binox.yaml
Normal file
@ -0,0 +1,10 @@
|
||||
mib: PRVT-INTERWORKING-OS-MIB:PRVT-SYS-MON-MIB
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
-
|
||||
oid: cpuMonitoringUtilization
|
||||
num_oid: '.1.3.6.1.4.1.738.10.111.1.1.3.1.1.{{ $index }}'
|
||||
-
|
||||
oid: prvtSysMonCurrentCpuUsage
|
||||
num_oid: '.1.3.6.1.4.1.738.10.111.3.1.1.{{ $index }}'
|
8
includes/definitions/discovery/ciscosb.yaml
Normal file
8
includes/definitions/discovery/ciscosb.yaml
Normal file
@ -0,0 +1,8 @@
|
||||
mib: CISCOSB-rndMng
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
-
|
||||
oid: rlCpuUtilDuringLastMinute
|
||||
num_oid: '.1.3.6.1.4.1.9.6.1.101.1.8.{{ $index }}'
|
||||
descr: CPU
|
7
includes/definitions/discovery/ciscowlc.yaml
Normal file
7
includes/definitions/discovery/ciscowlc.yaml
Normal file
@ -0,0 +1,7 @@
|
||||
mib: AIRESPACE-SWITCHING-MIB
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
-
|
||||
oid: agentCurrentCPUUtilization
|
||||
num_oid: '.1.3.6.1.4.1.14179.1.1.5.1.{{ $index }}'
|
8
includes/definitions/discovery/cyberoam-utm.yaml
Normal file
8
includes/definitions/discovery/cyberoam-utm.yaml
Normal file
@ -0,0 +1,8 @@
|
||||
mib: CYBEROAM-MIB
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
-
|
||||
oid: cpuPercentUsage
|
||||
num_oid: '.1.3.6.1.4.1.21067.2.1.2.2.1.{{ $index }}'
|
||||
type: cyberroam-utm
|
7
includes/definitions/discovery/dasan-nos.yaml
Normal file
7
includes/definitions/discovery/dasan-nos.yaml
Normal file
@ -0,0 +1,7 @@
|
||||
mib: DASAN-SWITCH-MIB
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
-
|
||||
oid: dsCpuLoad5s
|
||||
num_oid: '.1.3.6.1.4.1.6296.9.1.1.1.8.{{ $index }}'
|
@ -1,5 +1,11 @@
|
||||
mib: DMswitch-MIB
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
-
|
||||
oid: swCpuUsage
|
||||
num_oid: '.1.3.6.1.4.1.3709.3.5.201.1.1.10.{{ $index }}'
|
||||
precision: 100
|
||||
sensors:
|
||||
temperature:
|
||||
data:
|
||||
|
@ -1,6 +1,11 @@
|
||||
mib: EQUIPMENT-MIB
|
||||
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
-
|
||||
oid: AGENT-GENERAL-MIB::agentCPUutilizationIn5sec
|
||||
value: agentCPUutilizationIn5sec
|
||||
num_oid: '.1.3.6.1.4.1.171.12.1.1.6.1.{{ $index }}'
|
||||
sensors:
|
||||
temperature:
|
||||
data:
|
||||
|
7
includes/definitions/discovery/edgecos.yaml
Normal file
7
includes/definitions/discovery/edgecos.yaml
Normal file
@ -0,0 +1,7 @@
|
||||
mib: ECS4510-MIB
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
-
|
||||
oid: cpuCurrentUti
|
||||
num_oid: '.1.3.6.1.4.1.259.10.1.24.1.39.2.1.{{ $index }}'
|
8
includes/definitions/discovery/eltex-olt.yaml
Normal file
8
includes/definitions/discovery/eltex-olt.yaml
Normal file
@ -0,0 +1,8 @@
|
||||
mib: ELTEX-LTP8X-STANDALONE
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
-
|
||||
oid: ltp8xCPULoadAverage5Minutes
|
||||
num_oid: '.1.3.6.1.4.1.35265.1.22.1.10.4.{{ $index }}'
|
||||
precision: 10
|
9
includes/definitions/discovery/enterasys.yaml
Normal file
9
includes/definitions/discovery/enterasys.yaml
Normal file
@ -0,0 +1,9 @@
|
||||
mib: ENTERASYS-RESOURCE-UTILIZATION-MIB
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
-
|
||||
oid: etsysResourceCpuLoad5min
|
||||
num_oid: '.1.3.6.1.4.1.5624.1.2.49.1.1.1.1.4.{{ $index }}'
|
||||
index: '{{ $count }}'
|
||||
precision: 10
|
@ -1,13 +1,19 @@
|
||||
mib: CAMBIUM-PMP80211-MIB
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
-
|
||||
oid: sysCPUUsage
|
||||
num_oid: '.1.3.6.1.4.1.17713.21.2.1.64.{{ $index }}'
|
||||
type: cambium-cpu
|
||||
precision: 10
|
||||
sensors:
|
||||
|
||||
state:
|
||||
data:
|
||||
-
|
||||
oid: CAMBIUM-PMP80211-MIB::cambiumEffectiveSyncSource
|
||||
value: cambiumEffectiveSyncSource
|
||||
num_oid: .1.3.6.1.4.1.17713.21.1.1.7.
|
||||
index: 0
|
||||
oid: cambiumEffectiveSyncSource
|
||||
num_oid: '.1.3.6.1.4.1.17713.21.1.1.7.{{ $index }}'
|
||||
index: '{{ $index }}'
|
||||
descr: GPS Status
|
||||
states:
|
||||
- { value: 1, generic: 0, graph: 1, descr: GPS Sync Up }
|
||||
|
8
includes/definitions/discovery/fabos.yaml
Normal file
8
includes/definitions/discovery/fabos.yaml
Normal file
@ -0,0 +1,8 @@
|
||||
mib: SW-MIB
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
-
|
||||
oid: swCpuUsage
|
||||
num_oid: '.1.3.6.1.4.1.1588.2.1.1.1.26.1.{{ $index }}'
|
||||
index: 1
|
15
includes/definitions/discovery/fiberhome.yaml
Normal file
15
includes/definitions/discovery/fiberhome.yaml
Normal file
@ -0,0 +1,15 @@
|
||||
mib: GEPON-OLT-COMMON-MIB
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
-
|
||||
oid: mgrCardInfoTable
|
||||
value: mgrCardCpuUtil
|
||||
num_oid: '.1.3.6.1.4.1.5875.800.3.9.8.1.1.5.{{ $index }}'
|
||||
descr: 'Hswa {{ $index }} Processor'
|
||||
precision: 100
|
||||
skip_values:
|
||||
-
|
||||
oid: mgrCardWorkStatus
|
||||
op: '!='
|
||||
value: 1
|
8
includes/definitions/discovery/fortigate.yaml
Normal file
8
includes/definitions/discovery/fortigate.yaml
Normal file
@ -0,0 +1,8 @@
|
||||
mib: FORTINET-FORTIGATE-MIB
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
-
|
||||
oid: fgSysCpuUsage
|
||||
num_oid: '.1.3.6.1.4.1.12356.101.4.1.3.{{ $index }}'
|
||||
type: fortigate-fixed
|
8
includes/definitions/discovery/fortiswitch.yaml
Normal file
8
includes/definitions/discovery/fortiswitch.yaml
Normal file
@ -0,0 +1,8 @@
|
||||
mib: FORTINET-FORTISWITCH-MIB
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
-
|
||||
oid: fsSysCpuUsage
|
||||
num_oid: '.1.3.6.1.4.1.12356.106.4.1.2.{{ $index }}'
|
||||
index: 1
|
7
includes/definitions/discovery/hirschmann.yaml
Normal file
7
includes/definitions/discovery/hirschmann.yaml
Normal file
@ -0,0 +1,7 @@
|
||||
mib: HMPRIV-MGMT-SNMP-MIB
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
-
|
||||
oid: hmCpuUtilization
|
||||
num_oid: '.1.3.6.1.4.1.248.14.2.15.2.1.{{ $index }}'
|
7
includes/definitions/discovery/hpmsm.yaml
Normal file
7
includes/definitions/discovery/hpmsm.yaml
Normal file
@ -0,0 +1,7 @@
|
||||
mib: COLUBRIS-USAGE-INFORMATION-MIB
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
-
|
||||
oid: coUsInfoCpuUseNow
|
||||
num_oid: '.1.3.6.1.4.1.8744.5.21.1.1.5.{{ $index }}'
|
9
includes/definitions/discovery/jetstream.yaml
Normal file
9
includes/definitions/discovery/jetstream.yaml
Normal file
@ -0,0 +1,9 @@
|
||||
mib: TPLINK-SYSMONITOR-MIB
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
-
|
||||
oid: tpSysMonitorCpu5Seconds
|
||||
num_oid: '.1.3.6.1.4.1.11863.6.4.1.1.1.1.2.{{ $index }}'
|
||||
index: '{{ $index }}'
|
||||
descr: 'Proc #{{ $index }}'
|
7
includes/definitions/discovery/juniper-mss.yaml
Normal file
7
includes/definitions/discovery/juniper-mss.yaml
Normal file
@ -0,0 +1,7 @@
|
||||
mib: TRAPEZE-NETWORKS-SYSTEM-MIB
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
-
|
||||
oid: trpzSysCpuInstantLoad
|
||||
num_oid: '.1.3.6.1.4.1.14525.4.8.1.1.11.1.{{ $index }}'
|
@ -1,5 +1,18 @@
|
||||
mib: JUNIPER-IFOPTICS-MIB:JNX-OPT-IF-EXT-MIB:IF-MIB
|
||||
mib: JUNIPER-IFOPTICS-MIB:JNX-OPT-IF-EXT-MIB:IF-MIB:JUNIPER-MIB:JUNIPER-SRX5000-SPU-MONITORING-MIB
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
-
|
||||
oid: jnxOperatingEntry
|
||||
value: jnxOperatingCPU
|
||||
num_oid: '.1.3.6.1.4.1.2636.3.1.13.1.8.{{ $index }}'
|
||||
descr: jnxOperatingDescr
|
||||
skip_values: 0
|
||||
-
|
||||
oid: jnxJsSPUMonitoringCPUUsage
|
||||
value: jnxOperatingCPU
|
||||
num_oid: '.1.3.6.1.4.1.2636.3.39.1.12.1.1.1.4.{{ $index }}'
|
||||
descr: CPU
|
||||
sensors:
|
||||
pre-cache:
|
||||
data:
|
||||
@ -39,7 +52,7 @@ modules:
|
||||
index: 'jnxPMCurRxInputPower.{{ $index }}'
|
||||
-
|
||||
oid: jnxOpticsPMCurrentTable
|
||||
value: jnxPMCurTxOutputPower
|
||||
value: jnxPMCurTxOutputPower
|
||||
num_oid: .1.3.6.1.4.1.2636.3.71.1.2.1.1.7.
|
||||
entPhysicalIndex: '{{ $index }}'
|
||||
entPhysicalIndex_measured: 'ports'
|
||||
@ -50,8 +63,8 @@ modules:
|
||||
data:
|
||||
-
|
||||
oid: jnxOpticsPMCurrentTable
|
||||
value: jnxPMCurQ
|
||||
num_oid: .1.3.6.1.4.1.2636.3.71.1.2.1.1.5.
|
||||
value: jnxPMCurQ
|
||||
num_oid: .1.3.6.1.4.1.2636.3.71.1.2.1.1.5.
|
||||
entPhysicalIndex: '{{ $index }}'
|
||||
entPhysicalIndex_measured: 'ports'
|
||||
divisor: 10
|
||||
|
12
includes/definitions/discovery/junose.yaml
Normal file
12
includes/definitions/discovery/junose.yaml
Normal file
@ -0,0 +1,12 @@
|
||||
mib: Juniper-System-MIB
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
-
|
||||
oid: juniSystemModule
|
||||
value: juniSystemModuleCpuUtilPct
|
||||
num_oid: '.1.3.6.1.4.1.4874.2.2.2.1.3.5.1.3.{{ $index }}'
|
||||
descr: juniSystemModuleDescr
|
||||
entPhysicalIndex: juniSystemModulePhysicalIndex
|
||||
skip_values:
|
||||
- -1
|
10
includes/definitions/discovery/netscaler.yaml
Normal file
10
includes/definitions/discovery/netscaler.yaml
Normal file
@ -0,0 +1,10 @@
|
||||
mib: NS-ROOT-MIB
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
-
|
||||
oid: nsCPUTable
|
||||
value: nsCPUusage
|
||||
num_oid: '.1.3.6.1.4.1.5951.4.1.1.41.6.1.2."{{ $index }}"'
|
||||
index: nsCPUname
|
||||
descr: nsCPUname
|
8
includes/definitions/discovery/nos.yaml
Normal file
8
includes/definitions/discovery/nos.yaml
Normal file
@ -0,0 +1,8 @@
|
||||
mib: SW-MIB
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
-
|
||||
oid: swCpuUsage
|
||||
num_oid: '.1.3.6.1.4.1.1588.2.1.1.1.26.1.{{ $index }}'
|
||||
descr: CPU
|
9
includes/definitions/discovery/pbn.yaml
Normal file
9
includes/definitions/discovery/pbn.yaml
Normal file
@ -0,0 +1,9 @@
|
||||
mib: NMS-PROCESS-MIB
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
-
|
||||
oid: nmspmCPUTotal5min
|
||||
num_oid: '.1.3.6.1.4.1.11606.10.9.109.1.1.1.1.5.{{ $index }}'
|
||||
index: 0
|
||||
type: pbn-cpu
|
8
includes/definitions/discovery/procurve.yaml
Normal file
8
includes/definitions/discovery/procurve.yaml
Normal file
@ -0,0 +1,8 @@
|
||||
mib: STATISTICS-MIB
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
-
|
||||
oid: hpSwitchCpuStat
|
||||
num_oid: '.1.3.6.1.4.1.11.2.14.11.5.1.9.6.1.{{ $index }}'
|
||||
type: procurve-fixed
|
8
includes/definitions/discovery/pulse.yaml
Normal file
8
includes/definitions/discovery/pulse.yaml
Normal file
@ -0,0 +1,8 @@
|
||||
mib: PULSESECURE-PSG-MIB
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
-
|
||||
oid: iveCpuUtil
|
||||
num_oid: '.1.3.6.1.4.1.12532.10.{{ $index }}'
|
||||
type: pulse-cpu
|
7
includes/definitions/discovery/radlan.yaml
Normal file
7
includes/definitions/discovery/radlan.yaml
Normal file
@ -0,0 +1,7 @@
|
||||
mib: RADLAN-rndMng
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
-
|
||||
oid: rlCpuUtilDuringLast5Minutes
|
||||
num_oid: '.1.3.6.1.4.1.89.1.9.{{ $index }}'
|
@ -1,5 +1,13 @@
|
||||
mib: STEELHEAD-MIB:RBT-MIB
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
-
|
||||
oid: cpuUtil1
|
||||
num_oid: '.1.3.6.1.4.1.17163.1.1.5.1.4.{{ $index }}'
|
||||
precision: 1
|
||||
type: riverbed-cpu
|
||||
|
||||
sensors:
|
||||
temperature:
|
||||
data:
|
||||
|
@ -1,5 +1,12 @@
|
||||
mib: SAF-INTEGRAB-MIB
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
-
|
||||
oid: integraBsysCPUidle
|
||||
num_oid: '.1.3.6.1.4.1.7571.100.1.1.7.1.4.10.{{ $index }}'
|
||||
precision: -10
|
||||
type: saf-integra
|
||||
sensors:
|
||||
temperature:
|
||||
options:
|
||||
@ -54,4 +61,4 @@ modules:
|
||||
- { value: 1, generic: 0, graph: 1, descr: ok }
|
||||
- { value: 2, generic: 2, graph: 1, descr: expired }
|
||||
- { value: 3, generic: 3, graph: 1, descr: unknown }
|
||||
- { value: 4, generic: 0, graph: 1, descr: unlimitedTime }
|
||||
- { value: 4, generic: 0, graph: 1, descr: unlimitedTime }
|
||||
|
@ -1,5 +1,12 @@
|
||||
mib: SAF-INTEGRAW-MIB
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
-
|
||||
oid: integraWsysCPUidle
|
||||
num_oid: '.1.3.6.1.4.1.7571.100.1.1.7.2.4.10.{{ $index }}'
|
||||
precision: -10
|
||||
type: saf-integra
|
||||
sensors:
|
||||
temperature:
|
||||
options:
|
||||
@ -54,4 +61,4 @@ modules:
|
||||
- { value: 1, generic: 0, graph: 1, descr: ok }
|
||||
- { value: 2, generic: 2, graph: 1, descr: expired }
|
||||
- { value: 3, generic: 3, graph: 1, descr: unknown }
|
||||
- { value: 4, generic: 0, graph: 1, descr: unlimitedTime }
|
||||
- { value: 4, generic: 0, graph: 1, descr: unlimitedTime }
|
||||
|
8
includes/definitions/discovery/screenos.yaml
Normal file
8
includes/definitions/discovery/screenos.yaml
Normal file
@ -0,0 +1,8 @@
|
||||
mib: NETSCREEN-RESOURCE-MIB
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
-
|
||||
oid: nsResCpuLast5Min
|
||||
num_oid: '.1.3.6.1.4.1.3224.16.1.3.{{ $index }}'
|
||||
index: 1
|
@ -1,5 +1,11 @@
|
||||
mib: CHECKPOINT-MIB
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
-
|
||||
oid: procUsage
|
||||
num_oid: '.1.3.6.1.4.1.2620.1.6.7.2.4.{{ $index }}'
|
||||
type: splat-cpu
|
||||
sensors:
|
||||
fanspeed:
|
||||
data:
|
||||
@ -19,15 +25,15 @@ modules:
|
||||
oid: multiProcUsage
|
||||
num_oid: .1.3.6.1.4.1.2620.1.6.7.5.1.5.
|
||||
descr: CPU {{ $index }}
|
||||
index: 'multiProcUsage.{{ $index }}.0'
|
||||
|
||||
index: 'multiProcUsage.{{ $index }}.0'
|
||||
|
||||
state:
|
||||
data:
|
||||
-
|
||||
oid: fanSpeedSensorTable
|
||||
value: fanSpeedSensorStatus
|
||||
num_oid: .1.3.6.1.4.1.2620.1.6.7.8.2.1.6.
|
||||
descr: '{{ $fanSpeedSensorName }}'
|
||||
descr: '{{ $fanSpeedSensorName }}'
|
||||
index: 'fanSpeedSensorValue.{{ $index }}'
|
||||
state_name: fanSpeedSensor
|
||||
states:
|
||||
@ -50,4 +56,4 @@ modules:
|
||||
value: tempertureSensorValue
|
||||
num_oid: .1.3.6.1.4.1.2620.1.6.7.8.1.1.3.
|
||||
descr: '{{ $tempertureSensorName }}'
|
||||
index: 'tempertureSensorValue.{{ $index }}'
|
||||
index: 'tempertureSensorValue.{{ $index }}'
|
||||
|
8
includes/definitions/discovery/seos.yaml
Normal file
8
includes/definitions/discovery/seos.yaml
Normal file
@ -0,0 +1,8 @@
|
||||
mib: RBN-CPU-METER-MIB
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
-
|
||||
oid: rbnCpuMeterFiveSecondAvg
|
||||
num_oid: '.1.3.6.1.4.1.2352.2.6.1.1.{{ $index }}'
|
||||
|
8
includes/definitions/discovery/sonicwall.yaml
Normal file
8
includes/definitions/discovery/sonicwall.yaml
Normal file
@ -0,0 +1,8 @@
|
||||
mib: SONICWALL-FIREWALL-IP-STATISTICS-MIB
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
-
|
||||
oid: sonicCurrentCPUUtil
|
||||
num_oid: '.1.3.6.1.4.1.8741.1.3.1.3.{{ $index }}'
|
||||
descr: CPU
|
8
includes/definitions/discovery/timos.yaml
Normal file
8
includes/definitions/discovery/timos.yaml
Normal file
@ -0,0 +1,8 @@
|
||||
mib: TIMETRA-SYSTEM-MIB
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
-
|
||||
oid: sgiCpuUsage
|
||||
num_oid: '.1.3.6.1.4.1.6527.3.1.2.1.1.1.{{ $index }}'
|
||||
|
8
includes/definitions/discovery/viprinux.yaml
Normal file
8
includes/definitions/discovery/viprinux.yaml
Normal file
@ -0,0 +1,8 @@
|
||||
mib: VIPRINET-MIB
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
-
|
||||
oid: vpnRouterCPULoad
|
||||
num_oid: '.1.3.6.1.4.1.35424.1.2.1.{{ $index }}'
|
||||
type: viprinet-cpu
|
9
includes/definitions/discovery/xos.yaml
Normal file
9
includes/definitions/discovery/xos.yaml
Normal file
@ -0,0 +1,9 @@
|
||||
mib: EXTREME-SOFTWARE-MONITOR-MIB
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
-
|
||||
oid: extremeCpuMonitorSystemUtilization5mins
|
||||
num_oid: '.1.3.6.1.4.1.1916.1.32.1.4.1.9.{{ $index }}'
|
||||
index: 0
|
||||
type: extreme-cpu
|
12
includes/definitions/discovery/zynos.yaml
Normal file
12
includes/definitions/discovery/zynos.yaml
Normal file
@ -0,0 +1,12 @@
|
||||
mib: ZYXEL-ES-COMMON
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
-
|
||||
oid: ZYXEL-GS2200-24-MIB::sysMgmtCPUUsage
|
||||
value: sysMgmtCPUUsage
|
||||
snmp_flags: '-OeQUs -Pu' # workaround for underscores in mib
|
||||
num_oid: '.1.3.6.1.4.1.890.1.5.8.55.12.7.{{ $index }}'
|
||||
-
|
||||
oid: sysMgmtCPU5SecUsage
|
||||
num_oid: '.1.3.6.1.4.1.890.1.15.3.2.7.{{ $index }}'
|
@ -1,5 +1,10 @@
|
||||
mib: ZYXEL-ZYWALL-ZLD-COMMON-MIB
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
-
|
||||
oid: sysCPUUsage
|
||||
num_oid: '.1.3.6.1.4.1.890.1.6.22.1.1.{{ $index }}'
|
||||
sensors:
|
||||
pre-cache:
|
||||
data:
|
||||
|
7
includes/definitions/discovery/zyxelnwa.yaml
Normal file
7
includes/definitions/discovery/zyxelnwa.yaml
Normal file
@ -0,0 +1,7 @@
|
||||
mib: ZYXEL-ZYWALL-ZLD-COMMON-MIB
|
||||
modules:
|
||||
processors:
|
||||
data:
|
||||
-
|
||||
oid: sysCPUUsage
|
||||
num_oid: '.1.3.6.1.4.1.890.1.6.22.1.1.{{ $index }}'
|
@ -1,15 +1,14 @@
|
||||
os: enterasys
|
||||
text: Enterasys
|
||||
type: network
|
||||
mib_dir: enterasys
|
||||
icon: enterasys
|
||||
over:
|
||||
- { graph: device_bits, text: 'Device Traffic' }
|
||||
- { graph: device_processor, text: 'CPU Usage' }
|
||||
- { graph: device_mempool, text: 'Memory Usage' }
|
||||
icon: enterasys
|
||||
ifname: 1
|
||||
discovery:
|
||||
- sysObjectID: .1.3.6.1.4.1.5624.2.1
|
||||
- sysDescr: 'Enterasys Networks'
|
||||
good_if:
|
||||
- 'ras'
|
||||
- 'ras'
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user