mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Ericsson Traffic Node support (#13299)
* Initial commit * Removed unused function * fixed style * fixed style * fixed test data * Delete ericsson-tn_ericsson-tn.snmprec * Update ericsson-tn.yaml
This commit is contained in:
@@ -0,0 +1,133 @@
|
||||
<?php
|
||||
/**
|
||||
* EricssonTn.php
|
||||
*
|
||||
*
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* @copyright 2021 Maikel de Boer
|
||||
* @author Maikel de Boer <[email protected]>
|
||||
*/
|
||||
|
||||
namespace LibreNMS\OS;
|
||||
|
||||
use LibreNMS\Device\WirelessSensor;
|
||||
use LibreNMS\Interfaces\Discovery\Sensors\WirelessFrequencyDiscovery;
|
||||
use LibreNMS\Interfaces\Discovery\Sensors\WirelessPowerDiscovery;
|
||||
use LibreNMS\Interfaces\Discovery\Sensors\WirelessRateDiscovery;
|
||||
use LibreNMS\OS;
|
||||
|
||||
class EricssonTn extends OS implements
|
||||
WirelessFrequencyDiscovery,
|
||||
WirelessPowerDiscovery,
|
||||
WirelessRateDiscovery
|
||||
{
|
||||
public function discoverWirelessRate()
|
||||
{
|
||||
$sensors = [];
|
||||
|
||||
$data = snmpwalk_cache_oid($this->getDeviceArray(), 'xfTermBitPipeCapacity', [], 'XF-RADIOLINK-PTP-TERMINAL-MIB');
|
||||
$carrier = $this->getCacheTable('xfTermSysName', 'XF-RADIOLINK-PTP-TERMINAL-MIB');
|
||||
foreach ($data as $index => $entry) {
|
||||
$sensors[] = new WirelessSensor(
|
||||
'rate',
|
||||
$this->getDeviceId(),
|
||||
'.1.3.6.1.4.1.193.81.3.4.1.1.14.1.7.' . $index,
|
||||
'ericsson-6600',
|
||||
$index,
|
||||
'Rate: ' . $carrier[$index]['xfTermSysName'],
|
||||
null,
|
||||
1000,
|
||||
1
|
||||
);
|
||||
}
|
||||
|
||||
return $sensors;
|
||||
}
|
||||
|
||||
public function discoverWirelessFrequency()
|
||||
{
|
||||
$sensors = [];
|
||||
|
||||
$data_tx = snmpwalk_cache_oid($this->getDeviceArray(), 'xfRFBaseTxFrequency', [], 'XF-RADIOLINK-PTP-RADIO-MIB');
|
||||
$data_rx = snmpwalk_cache_oid($this->getDeviceArray(), 'xfRFBaseRxFrequency', [], 'XF-RADIOLINK-PTP-RADIO-MIB');
|
||||
$ifname = $this->getCacheTable('ifName', 'IF-MIB');
|
||||
foreach ($data_tx as $index => $entry) {
|
||||
$sensors[] = new WirelessSensor(
|
||||
'frequency',
|
||||
$this->getDeviceId(),
|
||||
'.1.3.6.1.4.1.193.81.3.4.3.1.2.1.1.' . $index,
|
||||
'ericsson-6600',
|
||||
$index . 'tx',
|
||||
'TX Frequency: ' . $ifname[$index]['ifName'],
|
||||
null,
|
||||
1,
|
||||
1000
|
||||
);
|
||||
}
|
||||
foreach ($data_rx as $index => $entry) {
|
||||
$sensors[] = new WirelessSensor(
|
||||
'frequency',
|
||||
$this->getDeviceId(),
|
||||
'.1.3.6.1.4.1.193.81.3.4.3.1.2.1.2.' . $index,
|
||||
'ericsson-6600',
|
||||
$index . 'rx',
|
||||
'RX Frequency: ' . $ifname[$index]['ifName'],
|
||||
null,
|
||||
1,
|
||||
1000
|
||||
);
|
||||
}
|
||||
|
||||
return $sensors;
|
||||
}
|
||||
|
||||
public function discoverWirelessPower()
|
||||
{
|
||||
$sensors = [];
|
||||
|
||||
$data_tx = snmpwalk_cache_oid($this->getDeviceArray(), 'xfRFCurrentOutputPower', [], 'XF-RADIOLINK-PTP-RADIO-MIB');
|
||||
$data_rx = snmpwalk_cache_oid($this->getDeviceArray(), 'xfRFCurrentInputPower', [], 'XF-RADIOLINK-PTP-RADIO-MIB');
|
||||
$ifname = $this->getCacheTable('ifName', 'IF-MIB');
|
||||
foreach ($data_tx as $index => $entry) {
|
||||
$sensors[] = new WirelessSensor(
|
||||
'power',
|
||||
$this->getDeviceId(),
|
||||
'.1.3.6.1.4.1.193.81.3.4.3.1.3.1.1.' . $index,
|
||||
'ericsson-tn',
|
||||
$index . 'tx',
|
||||
'Output power: ' . $ifname[$index]['ifName'],
|
||||
);
|
||||
}
|
||||
foreach ($data_rx as $index => $entry) {
|
||||
$sensors[] = new WirelessSensor(
|
||||
'power',
|
||||
$this->getDeviceId(),
|
||||
'.1.3.6.1.4.1.193.81.3.4.3.1.3.1.10.' . $index,
|
||||
'ericsson-tn',
|
||||
$index . 'rx',
|
||||
'Input power: ' . $ifname[$index]['ifName'],
|
||||
null,
|
||||
1,
|
||||
10
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
return $sensors;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
mib: XF-RADIOLINK-PTP-RADIO-MIB:XF-RADIOLINK-RLT-MIB:ENTITY-MIB:IF-MIB
|
||||
modules:
|
||||
os:
|
||||
hardware: ENTITY-MIB::entPhysicalDescr.1
|
||||
version: XF-SOFTWARE-MIB::xfSwReleaseRevision.1
|
||||
sensors:
|
||||
pre-cache:
|
||||
data:
|
||||
-
|
||||
oid:
|
||||
- entPhysicalName
|
||||
- ifName
|
||||
temperature:
|
||||
data:
|
||||
-
|
||||
oid: XfRAUEntry
|
||||
value: xfRAUTemperature
|
||||
num_oid: .1.3.6.1.4.1.193.81.3.4.3.1.1.1.8.{{ $index }}
|
||||
descr: 'RAU: {{ $entPhysicalName }}'
|
||||
|
||||
runtime:
|
||||
data:
|
||||
-
|
||||
oid: xfTermTimeElapsed
|
||||
num_oid: .1.3.6.1.4.1.193.81.3.4.1.1.4.1.1.{{ $index }}
|
||||
index: 'xfTermTimeElapsed.{{ $index }}'
|
||||
descr: 'Current Error Period: {{ $ifName }}'
|
||||
-
|
||||
oid: xfTermCurrentES
|
||||
num_oid: .1.3.6.1.4.1.193.81.3.4.1.1.4.1.2.{{ $index }}
|
||||
index: 'xfTermCurrentES.{{ $index }}'
|
||||
descr: 'Errored Seconds: {{ $ifName }}'
|
||||
-
|
||||
oid: xfTermCurrentSES
|
||||
num_oid: .1.3.6.1.4.1.193.81.3.4.1.1.4.1.3.{{ $index }}
|
||||
index: 'xfTermCurrentSES.{{ $index }}'
|
||||
descr: 'Severly Errored Seconds: {{ $ifName }}'
|
||||
-
|
||||
oid: xfTermCurrentUAS
|
||||
num_oid: .1.3.6.1.4.1.193.81.3.4.1.1.4.1.5.{{ $index }}
|
||||
index: 'xfTermCurrentUAS.{{ $index }}'
|
||||
descr: 'Unavailable Seconds: {{ $ifName }}'
|
||||
count:
|
||||
data:
|
||||
-
|
||||
oid: xfTermCurrentBBE
|
||||
num_oid: .1.3.6.1.4.1.193.81.3.4.1.1.4.1.4.{{ $index }}
|
||||
index: 'xfTermCurrentBBE.{{ $index }}'
|
||||
descr: 'Background Block Errors: {{ $ifName }}'
|
||||
-
|
||||
oid: xfTermCurrentBB
|
||||
num_oid: .1.3.6.1.4.1.193.81.3.4.1.1.4.1.6.{{ $index }}
|
||||
index: 'xfTermCurrentBB.{{ $index }}'
|
||||
descr: 'Background blocks: {{ $ifName }}'
|
||||
state:
|
||||
data:
|
||||
-
|
||||
oid: xfRFTxOperStatus
|
||||
value: xfRFTxOperStatus
|
||||
num_oid: '.1.3.6.1.4.1.193.81.3.4.3.1.2.1.7.{{ $index }}'
|
||||
descr: 'RAU: {{ $ifName }}'
|
||||
group: Operational status
|
||||
index: 'xfRFTxOperStatus.{{ $index }}'
|
||||
state_name: Operational status
|
||||
states:
|
||||
- { value: 4, generic: 3, graph: 0, descr: 'Stand-by' }
|
||||
- { value: 3, generic: 0, graph: 0, descr: TX On }
|
||||
- { value: 2, generic: 2, graph: 0, descr: TX Off }
|
||||
- { value: 1, generic: 3, graph: 0, descr: Other }
|
||||
|
||||
-
|
||||
oid: xfRFTxAdminStatus
|
||||
value: xfRFTxAdminStatus
|
||||
num_oid: '.1.3.6.1.4.1.193.81.3.4.3.1.2.1.8.{{ $index }}'
|
||||
descr: 'RAU: {{ $ifName }}'
|
||||
group: Admin status
|
||||
index: 'xfRFTxAdminStatus.{{ $index }}'
|
||||
state_name: Admin status
|
||||
states:
|
||||
- { value: 4, generic: 3, graph: 0, descr: 'Stand-by' }
|
||||
- { value: 3, generic: 0, graph: 0, descr: TX On }
|
||||
- { value: 2, generic: 2, graph: 0, descr: TX Off }
|
||||
- { value: 1, generic: 3, graph: 0, descr: Other }
|
||||
@@ -0,0 +1,9 @@
|
||||
os: ericsson-tn
|
||||
text: 'Ericsson Traffic Node'
|
||||
type: wireless
|
||||
icon: ericsson
|
||||
discovery:
|
||||
-
|
||||
sysObjectID:
|
||||
- .1.3.6.1.4.1.193.81.1.1.3
|
||||
mib_dir: ericsson
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user