Ceraos more sensors (#9392)

* Update to Added support for HeliOS 10Ghz failover to 5Ghz state sensor
Converted /includes/discovery/sensors/state/helios.inc.php to yaml
Test units included
CLA has been signed

* Added support for CeraOS TX Mute Status state sensor, NTP Client Lock Status state sensor.
Updated CeraOS temperature sensor, now called from includes/definitions/discovery/ceraos.yaml - removed includes/discovery/sensors/temperature/ceraos.inc.php
Corrected issue with CeraOS temperature reverting to zero after polling (added a trailing . to the num_oid)
Amended includes/definitions/discovery/helios.yaml with changes as advised by Neil Lathwood and Tony Murray

* Added unit test data and corrected ceraos.yaml validation error

* Added support for Ceraos Wireless Sensors (php)
Cross Polar Interference
Wireless Frequency

Added Ceraos state sensors (yaml)
NTP Client Lock Status
Tx Mute Status
Radio Operational Status
Remote Radio Operational Status
IDU Temperature
Power Amplifier Temperature

* Fix up tests, etc

* remove helios changes, fix style
This commit is contained in:
markoh76
2018-12-11 14:41:26 +00:00
committed by Tony Murray
parent 4413d8c092
commit 7bf769e19c
12 changed files with 2207 additions and 308 deletions

View File

@@ -192,6 +192,12 @@ class WirelessSensor extends Sensor
'unit' => 'dB',
'icon' => 'signal',
),
'xpi' => array(
'short' => 'XPI',
'long' => 'Cross Polar Interference',
'unit' => 'dB',
'icon' => 'signal',
),
'rssi' => array(
'short' => 'RSSI',
'long' => 'Received Signal Strength Indicator',

View File

@@ -0,0 +1,37 @@
<?php
/**
* WirelessXpiDiscovery.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\Interfaces\Discovery\Sensors;
interface WirelessXpiDiscovery
{
/**
* Discover wireless Cross Polar Interference. Measured in dB. Type is xpi.
* Returns an array of LibreNMS\Device\Sensor objects that have been discovered
*
* @return array Sensors
*/
public function discoverWirelessXpi();
}

View File

@@ -0,0 +1,38 @@
<?php
/**
* WirelessXpiPolling.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\Interfaces\Polling\Sensors;
interface WirelessXpiPolling
{
/**
* Poll wireless Cross Polar Interference.
* The returned array should be sensor_id => value pairs
*
* @param array $sensors Array of sensors needed to be polled
* @return array of polled data
*/
public function pollWirelessApCount(array $sensors);
}

View File

@@ -26,14 +26,81 @@
namespace LibreNMS\OS;
use LibreNMS\Device\WirelessSensor;
use LibreNMS\Interfaces\Discovery\Sensors\WirelessFrequencyDiscovery;
use LibreNMS\Interfaces\Discovery\Sensors\WirelessErrorsDiscovery;
use LibreNMS\Interfaces\Discovery\Sensors\WirelessMseDiscovery;
use LibreNMS\Interfaces\Discovery\Sensors\WirelessPowerDiscovery;
use LibreNMS\Interfaces\Discovery\Sensors\WirelessRateDiscovery;
use LibreNMS\Interfaces\Discovery\Sensors\WirelessXpiDiscovery;
use LibreNMS\OS;
class Ceraos extends OS implements WirelessErrorsDiscovery, WirelessMseDiscovery, WirelessPowerDiscovery, WirelessRateDiscovery
class Ceraos extends OS implements WirelessXpiDiscovery, WirelessFrequencyDiscovery, WirelessErrorsDiscovery, WirelessMseDiscovery, WirelessPowerDiscovery, WirelessRateDiscovery
{
public function discoverWirelessXpi()
{
$ifNames = $this->getCacheByIndex('ifName', 'IF-MIB');
$sensors = [];
$divisor = 100;
$xpi = snmpwalk_group($this->getDevice(), 'genEquipRadioStatusXPI', 'MWRM-RADIO-MIB');
foreach ($xpi as $index => $data) {
$sensors[] = new WirelessSensor(
'xpi',
$this->getDeviceId(),
'.1.3.6.1.4.1.2281.10.7.1.1.5.' . $index,
'ceraos',
$index,
$ifNames[$index],
$data['genEquipRadioStatusXPI'] / $divisor,
1,
$divisor
);
}
return $sensors;
}
public function discoverWirelessFrequency()
{
$sensors = [];
// MWRM-RADIO-MIB::genEquipRfuCfgTxFreq
$tx = snmpwalk_group($this->getDevice(), 'genEquipRfuCfgTxFreq', 'MWRM-RADIO-MIB');
$TxRadio = 0;
foreach ($tx as $index => $data) {
$TxRadio++;
$sensors[] = new WirelessSensor(
'frequency',
$this->getDeviceId(),
'.1.3.6.1.4.1.2281.10.5.2.1.3.' . $index,
'Ceraos-tx-radio ' . $TxRadio,
1,
'Tx Frequency Radio ' . $TxRadio,
null,
1,
1000
);
}
// MWRM-RADIO-MIB::genEquipRfuCfgRxFreq
$rx = snmpwalk_group($this->getDevice(), 'genEquipRfuCfgRxFreq', 'MWRM-RADIO-MIB');
$RxRadio = 0;
foreach ($rx as $index => $data) {
$RxRadio++;
$sensors[] = new WirelessSensor(
'frequency',
$this->getDeviceId(),
'.1.3.6.1.4.1.2281.10.5.2.1.4.' . $index,
'Ceraos-rx-radio ' . $RxRadio,
1,
'Rx Frequency Radio ' . $RxRadio,
null,
1,
1000
);
}
return $sensors;
}
/**
* Discover wireless rate. This is in bps. Type is rate.
* Returns an array of LibreNMS\Device\Sensor objects that have been discovered
@@ -44,7 +111,7 @@ class Ceraos extends OS implements WirelessErrorsDiscovery, WirelessMseDiscovery
{
$ifNames = $this->getCacheByIndex('ifName', 'IF-MIB');
$sensors = array();
$sensors = [];
$tx = snmpwalk_group($this->getDevice(), 'genEquipRadioMRMCCurrTxBitrate', 'MWRM-RADIO-MIB');
foreach ($tx as $index => $data) {
@@ -87,7 +154,7 @@ class Ceraos extends OS implements WirelessErrorsDiscovery, WirelessMseDiscovery
{
$ifNames = $this->getCacheByIndex('ifName', 'IF-MIB');
$sensors = array();
$sensors = [];
$mse = snmpwalk_group($this->getDevice(), 'genEquipRadioStatusDefectedBlocks', 'MWRM-RADIO-MIB');
foreach ($mse as $index => $data) {
@@ -115,7 +182,7 @@ class Ceraos extends OS implements WirelessErrorsDiscovery, WirelessMseDiscovery
{
$ifNames = $this->getCacheByIndex('ifName', 'IF-MIB');
$sensors = array();
$sensors = [];
$divisor = 100;
$mse = snmpwalk_group($this->getDevice(), 'genEquipRadioStatusMSE', 'MWRM-RADIO-MIB');
@@ -146,7 +213,7 @@ class Ceraos extends OS implements WirelessErrorsDiscovery, WirelessMseDiscovery
{
$ifNames = $this->getCacheByIndex('ifName', 'IF-MIB');
$sensors = array();
$sensors = [];
$tx = snmpwalk_group($this->getDevice(), 'genEquipRfuStatusTxLevel', 'MWRM-RADIO-MIB');
foreach ($tx as $index => $data) {

View File

@@ -23,6 +23,7 @@ Currently we have support for the following wireless metrics along with the valu
| rate | bps | WirelessRateDiscovery | The negotiated rate of the connection (not data transfer) |
| rssi | dBm | WirelessRssiDiscovery | The Received Signal Strength Indicator |
| snr | dB | WirelessSnrDiscovery | The Signal to Noise ratio, which is signal - noise floor |
| xpi | dBm | WirelessXpiDiscovery | The Cross Polar Interference values |
| ssr | dB | WirelessSsrDiscovery | The Signal strength ratio, the ratio(or difference) of Vertical rx power to Horizontal rx power |
| utilization | % | WirelessUtilizationDiscovery | The % of utilization compared to the current rate |

View File

@@ -16,24 +16,20 @@ poller_modules:
hr-mib: false
ipSystemStats: false
ipmi: false
mempools: false
netstats: false
ntp: false
ospf: false
processors: false
services: false
storage: false
ucd-diskio: false
ucd-mib: false
discovery_modules:
ports-stack: false
entity-physical: false
processors: false
mempools: false
cisco-vrf-lite: false
ipv4-addresses: false
ipv6-addresses: false
storage: false
hr-device: false
discovery-protocols: false
arp-table: false

View File

@@ -0,0 +1,48 @@
mib: MWRM-UNIT-MIB:MWRM-RADIO-MIB
modules:
sensors:
state:
data:
-
oid: genEquipUnitInfoNtpStatusLockState
num_oid: .1.3.6.1.4.1.2281.10.1.1.11.6.6.1.4.{{ $index }}
descr: NTP Client Lock Status
state_name: genEquipUnitInfoNtpStatusLockState
states:
- { value: 0, generic : 0, graph: 0, descr: None }
- { value: 1, generic : 0, graph: 0, descr: Local }
- { value: 2, generic : 0, graph: 0, descr: Locked }
-
oid: genEquipRfuStatusTxMute
num_oid: .1.3.6.1.4.1.2281.10.5.1.1.25.{{ $index }}
descr: TX Mute Status
state_name: genEquipRfuStatusTxMute
states:
- { value: 0, generic: 0, graph: 0, descr: Disabled }
- { value: 1, generic: 0, graph: 0, descr: Enabled }
-
oid: genEquipRadioCfgRadioOperationalStatus
num_oid: .1.3.6.1.4.1.2281.10.7.2.1.9.{{ $index }}
descr: Radio Operational Status
state_name: genEquipRadioCfgRadioOperationalStatus
states:
- { value: 0, generic : 0, graph: 0, descr: Inactive }
- { value: 1, generic : 0, graph: 0, descr: Active }
-
oid: genEquipRemoteRadioRemoteCommunication
num_oid: .1.3.6.1.4.1.2281.10.7.3.1.1.2.{{ $index }}
descr: Remote Radio Operational Status
state_name: genEquipRemoteRadioRemoteCommunication
states:
- { value: 0, generic: 0, graph: 0, descr: Inactive }
- { value: 1, generic: 0, graph: 0, descr: Active }
temperature:
data:
-
oid: genEquipUnitIduTemperature
num_oid: .1.3.6.1.4.1.2281.10.1.1.9.{{ $index }}
descr: IDU Temperature
-
oid: genEquipRfuStatusPATemp
num_oid: .1.3.6.1.4.1.2281.10.5.1.1.24.{{ $index }}
descr: Power Amplifier Temperature

View File

@@ -1,18 +0,0 @@
<?php
$mib = 'genEquipUnitIduTemperature.0';
$oid = '.1.3.6.1.4.1.2281.10.1.1.9.0';
$oids = snmp_get($device, $mib, '-OsqnU', 'MWRM-UNIT-MIB');
d_echo($oids."\n");
if (!empty($oids)) {
echo ' Ceragon CeraOS Temperature ';
$divisor = 1;
$type = 'ceraos';
list(,$current) = explode(' ', $oids);
$index = $oid;
$descr = 'System Temp';
discover_sensor($valid['sensor'], 'temperature', $device, $oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
}

File diff suppressed because it is too large Load Diff

1362
tests/data/helios.json Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -145,6 +145,16 @@
1.3.6.1.2.1.31.1.1.1.5.268451970|65|0
1.3.6.1.2.1.31.1.1.1.5.268460097|65|0
1.3.6.1.2.1.31.1.1.1.5.268562561|65|0
1.3.6.1.2.1.31.1.1.1.6.268443713|70|0
1.3.6.1.2.1.31.1.1.1.6.268443714|70|0
1.3.6.1.2.1.31.1.1.1.6.268451969|70|0
1.3.6.1.2.1.31.1.1.1.6.268451970|70|0
1.3.6.1.2.1.31.1.1.1.6.268562561|70|0
1.3.6.1.2.1.31.1.1.1.10.268443713|70|29898
1.3.6.1.2.1.31.1.1.1.10.268443714|70|29898
1.3.6.1.2.1.31.1.1.1.10.268451969|70|0
1.3.6.1.2.1.31.1.1.1.10.268451970|70|0
1.3.6.1.2.1.31.1.1.1.10.268562561|70|0
1.3.6.1.2.1.31.1.1.1.14.268443713|2|1
1.3.6.1.2.1.31.1.1.1.14.268443714|2|1
1.3.6.1.2.1.31.1.1.1.14.268451969|2|1
@@ -171,6 +181,7 @@
1.3.6.1.2.1.31.1.1.1.18.268562561|4|
1.3.6.1.4.1.2281.10.1.1.9.0|2|35
1.3.6.1.4.1.2281.10.1.1.10.0|2|47
1.3.6.1.4.1.2281.10.1.1.11.6.6.1.4.1|2|1
1.3.6.1.4.1.2281.10.1.1.14.5.0|4|
1.3.6.1.4.1.2281.10.1.1.14.6.0|4|
1.3.6.1.4.1.2281.10.1.2.10.1.1.6.127|4|F217305963
@@ -183,6 +194,8 @@
1.3.6.1.4.1.2281.10.5.1.1.3.268451906|2|24
1.3.6.1.4.1.2281.10.5.1.1.3.268451969|2|16
1.3.6.1.4.1.2281.10.5.1.1.3.268451970|2|16
1.3.6.1.4.1.2281.10.5.1.1.25.268451969|2|1
1.3.6.1.4.1.2281.10.5.1.1.25.268451970|2|1
1.3.6.1.4.1.2281.10.7.1.1.2.268451905|2|-6734
1.3.6.1.4.1.2281.10.7.1.1.2.268451906|2|-9900
1.3.6.1.4.1.2281.10.7.1.1.2.268451969|2|-4212
@@ -191,6 +204,9 @@
1.3.6.1.4.1.2281.10.7.1.1.3.268451906|2|0
1.3.6.1.4.1.2281.10.7.1.1.3.268451969|2|7462
1.3.6.1.4.1.2281.10.7.1.1.3.268451970|2|1881
1.3.6.1.4.1.2281.10.7.1.1.5.268451905|2|1
1.3.6.1.4.1.2281.10.7.1.1.5.268451906|2|3
1.3.6.1.4.1.2281.10.7.1.1.5.268451969|2|4
1.3.6.1.4.1.2281.10.7.4.1.1.7.268451905|2|77
1.3.6.1.4.1.2281.10.7.4.1.1.7.268451906|2|86
1.3.6.1.4.1.2281.10.7.4.1.1.7.268451969|2|445020

View File

@@ -1,2 +1,117 @@
1.3.6.1.2.1.1.1.0|4|
1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.47307
1.3.6.1.2.1.1.3.0|67|24195028
1.3.6.1.2.1.1.4.0|4|<private>
1.3.6.1.2.1.1.5.0|4|<private>
1.3.6.1.2.1.1.6.0|4|<private>
1.3.6.1.2.1.2.2.1.2.1|4|lo
1.3.6.1.2.1.2.2.1.2.2|4|eth0
1.3.6.1.2.1.2.2.1.2.3|4|eth1
1.3.6.1.2.1.2.2.1.2.4|4|wlan0
1.3.6.1.2.1.2.2.1.2.5|4|wlan1
1.3.6.1.2.1.2.2.1.3.1|2|24
1.3.6.1.2.1.2.2.1.3.2|2|6
1.3.6.1.2.1.2.2.1.3.3|2|6
1.3.6.1.2.1.2.2.1.3.4|2|6
1.3.6.1.2.1.2.2.1.3.5|2|6
1.3.6.1.2.1.2.2.1.4.1|2|65536
1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1.2.2.1.20.5|65|0
1.3.6.1.2.1.25.1.1.0|67|24199465
1.3.6.1.2.1.25.1.5.0|66|0
1.3.6.1.2.1.25.1.6.0|66|55
1.3.6.1.2.1.31.1.1.1.1.1|4|lo
1.3.6.1.2.1.31.1.1.1.1.2|4|eth0
1.3.6.1.2.1.31.1.1.1.1.3|4|eth1
1.3.6.1.2.1.31.1.1.1.1.4|4|wlan0
1.3.6.1.2.1.31.1.1.1.1.5|4|wlan1
1.3.6.1.2.1.31.1.1.1.2.1|65|0
1.3.6.1.2.1.31.1.1.1.2.2|65|8064
1.3.6.1.2.1.31.1.1.1.2.3|65|0
1.3.6.1.2.1.31.1.1.1.2.4|65|0
1.3.6.1.2.1.31.1.1.1.2.5|65|7254
1.3.6.1.2.1.31.1.1.1.6.1|70|0
1.3.6.1.2.1.31.1.1.1.6.2|70|19053702320
1.3.6.1.2.1.31.1.1.1.6.3|70|0
1.3.6.1.2.1.31.1.1.1.6.4|70|0
1.3.6.1.2.1.31.1.1.1.6.5|70|83485124
1.3.6.1.2.1.31.1.1.1.8.1|70|0
1.3.6.1.2.1.31.1.1.1.8.2|70|8064
1.3.6.1.2.1.31.1.1.1.8.3|70|0
1.3.6.1.2.1.31.1.1.1.8.4|70|0
1.3.6.1.2.1.31.1.1.1.8.5|70|7254
1.3.6.1.2.1.31.1.1.1.10.1|70|0
1.3.6.1.2.1.31.1.1.1.10.2|70|1680217111
1.3.6.1.2.1.31.1.1.1.10.3|70|0
1.3.6.1.2.1.31.1.1.1.10.4|70|0
1.3.6.1.2.1.31.1.1.1.10.5|70|3552309065
1.3.6.1.2.1.31.1.1.1.15.1|66|10
1.3.6.1.2.1.31.1.1.1.15.2|66|0
1.3.6.1.2.1.31.1.1.1.15.3|66|0
1.3.6.1.2.1.31.1.1.1.15.4|66|0
1.3.6.1.2.1.31.1.1.1.15.5|66|0
1.3.6.1.2.1.31.1.1.1.16.1|2|0
1.3.6.1.2.1.31.1.1.1.16.2|2|0
1.3.6.1.2.1.31.1.1.1.16.3|2|0
1.3.6.1.2.1.31.1.1.1.16.4|2|0
1.3.6.1.2.1.31.1.1.1.16.5|2|0
1.3.6.1.4.1.2021.4.5.0|2|255544
1.3.6.1.4.1.2021.4.6.0|2|185524
1.3.6.1.4.1.2021.4.13.0|2|0
1.3.6.1.4.1.2021.4.14.0|2|4520
1.3.6.1.4.1.2021.4.15.0|2|13040
1.3.6.1.4.1.2021.10.1.5.1|2|2
1.3.6.1.4.1.2021.10.1.5.2|2|3
1.3.6.1.4.1.2021.10.1.5.3|2|5
1.3.6.1.4.1.2021.11.50.0|65|148868
1.3.6.1.4.1.2021.11.51.0|65|0
1.3.6.1.4.1.2021.11.52.0|65|156739
1.3.6.1.4.1.2021.11.53.0|65|48005311
1.3.6.1.4.1.2021.11.59.0|65|588280603
1.3.6.1.4.1.2021.11.60.0|65|99262405
1.3.6.1.4.1.47307.1.1.1.0|4|ML-60-30-18
1.3.6.1.4.1.47307.1.1.3.0|4|1.1.9-9791-1b3b6d8c
1.3.6.1.4.1.47307.1.4.2.1.4.1|2|5540
1.3.6.1.4.1.47307.1.4.2.1.4.2|2|58320
1.3.6.1.4.1.47307.1.4.2.1.7.1|2|27
1.3.6.1.4.1.47307.1.4.2.1.7.2|2|14
1.3.6.1.4.1.47307.1.4.2.1.10.1|2|0
1.3.6.1.4.1.47307.1.4.2.1.10.2|2|-63
1.3.6.1.4.1.47307.1.4.3.1.2.2|2|0