Teleste Luminato ports & qam/asi output sensors & yaml (#13616)

* Luminato: bitrate sensor

* bitrate sensor Eloquent

* luminato ports

* luminato ports styleci

* luminato QAM/ASI sensor

* luminato QAM/ASI sensor styleci

* YAML & test

* drop debug $ver from sensor type

* mess with Teleste ifExtPhysInterface/ifExtLogiInterface

* styleci

* test data

* mistake in port discovery

* left out Graphs->Health->Overview->Bitrate label

* fixed Bitrate graph, copy/paste errors
This commit is contained in:
Peca Nesovanovic
2022-01-08 18:17:08 +01:00
committed by GitHub
parent 4696b7fc3d
commit 2d57e49caf
20 changed files with 653 additions and 8 deletions

View File

@@ -0,0 +1,42 @@
<?php
/**
* luminato.inc.php
*
* LibreNMS poller module for Teleste Luminato. Modify: ifSpeed ifHighSpeed ifOperStatus
*
* 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 <https://www.gnu.org/licenses/>.
*
* @link https://www.librenms.org
*
* @copyrigh 2021 Peca Nesovanovic
*
* @author peca.nesovanovic@sattrakt.com
*/
$ver = intval($device['version']);
d_echo('PORTS: Luminato v' . $ver);
$rfcmib = SnmpQuery::walk('RFC1213-MIB::ifSpeed')->table(2);
foreach ($port_stats as $key => $data) {
$speed = $rfcmib[$key]['RFC1213-MIB::ifSpeed'];
if ($ver >= 20) {
$port_stats[$key]['ifOperStatus'] = $data['ifConnectorPresent'] ? 'up' : 'down';
} else {
$speed = $speed / 1000000;
}
$port_stats[$key]['ifHighSpeed'] = $speed;
$port_stats[$key]['ifSpeed'] = 0;
}