mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Improve support for Arista/Metamako MOS devices (#13988)
* Improve support for legacy Arista/Metamako MOS devices * Fix indentation in license text * Fix formatting in OS discovery * Add hardware type discovery for Arista/Metamako MOS * style fixes * Implement hardware model detection for Arista MOS * Refactor to use YAML based OS discovery * Reformat test data for arista-mos_metamux48, 0.16 code * Enable lm_sensors polling of Arista MOS devices * Remove bgp-peers data from arista-mos test files
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
modules:
|
||||
os:
|
||||
serial: SNMPv2-MIB::snmpSetSerialNo.0
|
||||
sysDescr_regex: '/release (?<version>[\d\.]+)/'
|
||||
sysDescr_regex: '/release (?<version>[\d\.]+).*?running\son\sa\s(?<hardware>.*)$/'
|
||||
|
5
includes/discovery/sensors/fanspeed/arista-mos.inc.php
Normal file
5
includes/discovery/sensors/fanspeed/arista-mos.inc.php
Normal file
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
use LibreNMS\Config;
|
||||
|
||||
include_once Config::get('install_dir') . '/includes/discovery/sensors/fanspeed/unix.inc.php';
|
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
use LibreNMS\Config;
|
||||
|
||||
include_once Config::get('install_dir') . '/includes/discovery/sensors/temperature/unix.inc.php';
|
5
includes/discovery/sensors/voltage/arista-mos.inc.php
Normal file
5
includes/discovery/sensors/voltage/arista-mos.inc.php
Normal file
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
use LibreNMS\Config;
|
||||
|
||||
include_once Config::get('install_dir') . '/includes/discovery/sensors/voltage/unix.inc.php';
|
29
includes/polling/sensors/fanspeed/arista-mos.inc.php
Normal file
29
includes/polling/sensors/fanspeed/arista-mos.inc.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
/**
|
||||
* arista-mos.inc.php
|
||||
*
|
||||
* Copyright (C) 2018 Goldman Sachs & Co.
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
* @author Nash Kaminski <Nash.Kaminski@gs.com>
|
||||
*/
|
||||
|
||||
// Workaround for Metamako platform fanspeed reporting bug on early (circa 0.16.x) code versions
|
||||
if ((strpos($sensor['sensor_oid'], '.1.3.6.1.4.1.2021.13.16.3.1.3.') === 0) &&
|
||||
($sensor_value >= 2 ** 31)) {
|
||||
// 2's complement negation of the value
|
||||
$sensor_value = $sensor_value ^ 0xFFFFFFFF;
|
||||
$sensor_value += 1;
|
||||
}
|
@@ -8,7 +8,7 @@
|
||||
"sysDescr": "Metamako MOS release 0.32.0 \\\\(build mos-0.32+22\\\\) running on a MetaMux 48 with L-Series",
|
||||
"sysContact": "<private>",
|
||||
"version": "0.32.0",
|
||||
"hardware": null,
|
||||
"hardware": "MetaMux 48 with L-Series",
|
||||
"features": null,
|
||||
"os": "arista-mos",
|
||||
"type": "network",
|
||||
|
31875
tests/data/arista-mos_metamux48_c_0_16.json
Normal file
31875
tests/data/arista-mos_metamux48_c_0_16.json
Normal file
File diff suppressed because it is too large
Load Diff
5227
tests/snmpsim/arista-mos_metamux48_c_0_16.snmprec
Normal file
5227
tests/snmpsim/arista-mos_metamux48_c_0_16.snmprec
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user