Fix Cisco Sat style (#9902)

* Fix Cisco Sat style

* update index
This commit is contained in:
Tony Murray
2019-03-04 21:12:12 -06:00
committed by GitHub
parent d13d370711
commit b402e859fd
2 changed files with 29 additions and 26 deletions
+23 -20
View File
@@ -1,4 +1,5 @@
<?php
namespace LibreNMS\OS;
use LibreNMS\Device\WirelessSensor;
@@ -11,8 +12,8 @@ class Ciscosat extends OS implements WirelessErrorsDiscovery, WirelessRssiDiscov
{
public function discoverWirelessErrors()
{
$oids = snmpwalk_cache_oid($this->getDevice(), 'satSignalUncorErrCnt', array(), 'CISCO-DMN-DSG-TUNING-MIB', null, '-Ob');
$sensors = array();
$oids = snmpwalk_cache_oid($this->getDevice(), 'satSignalUncorErrCnt', [], 'CISCO-DMN-DSG-TUNING-MIB', null, '-Ob');
$sensors = [];
foreach ($oids as $index => $entry) {
$sensors[] = new WirelessSensor(
'errors',
@@ -28,8 +29,8 @@ class Ciscosat extends OS implements WirelessErrorsDiscovery, WirelessRssiDiscov
public function discoverWirelessRssi()
{
$oids = snmpwalk_cache_oid($this->getDevice(), 'satSignalLevel', array(), 'CISCO-DMN-DSG-TUNING-MIB', null, '-Ob');
$sensors = array();
$oids = snmpwalk_cache_oid($this->getDevice(), 'satSignalLevel', [], 'CISCO-DMN-DSG-TUNING-MIB', null, '-Ob');
$sensors = [];
foreach ($oids as $index => $entry) {
$sensors[] = new WirelessSensor(
'rssi',
@@ -37,42 +38,44 @@ class Ciscosat extends OS implements WirelessErrorsDiscovery, WirelessRssiDiscov
'.1.3.6.1.4.1.1429.2.2.5.5.3.1.1.7.' . $index,
'ciscosat',
$index,
'Receive Signal Level ' .$index
'Receive Signal Level ' . $index
);
}
return $sensors;
}
// snr - Discover C/N Link Margin
public function discoverWirelessSnr()
{
$cnmargin = snmpwalk_cache_oid($this->getDevice(), 'satSignalCnMargin', array(), 'CISCO-DMN-DSG-TUNING-MIB', null, '-OQUsb');
$dbindex = 0;
$sensors = [];
// snr - Discover C/N Link Margin
$cnmargin = snmpwalk_cache_oid($this->getDevice(), 'satSignalCnMargin', [], 'CISCO-DMN-DSG-TUNING-MIB', null, '-OQUsb');
foreach ($cnmargin as $index => $entry) {
$snrstatus[] = new WirelessSensor(
$sensors[] = new WirelessSensor(
'snr',
$this->getDeviceId(),
'.1.3.6.1.4.1.1429.2.2.5.5.3.1.1.6.' . $index,
'ciscosat',
++$dbindex,
'C/N Link Margin ' .$index,
'ciscosat-cn-margin',
$index,
'C/N Link Margin ' . $index,
$entry
);
}
// snr - Discover C/N Ratio
$cnratio = snmpwalk_cache_oid($this->getDevice(), 'satSignalCndisp', array(), 'CISCO-DMN-DSG-TUNING-MIB', null, '-OQUsb');
// snr - Discover C/N Ratio
$cnratio = snmpwalk_cache_oid($this->getDevice(), 'satSignalCndisp', [], 'CISCO-DMN-DSG-TUNING-MIB', null, '-OQUsb');
foreach ($cnratio as $index => $entry) {
array_push($snrstatus, new WirelessSensor(
$sensors[] = new WirelessSensor(
'snr',
$this->getDeviceId(),
'.1.3.6.1.4.1.1429.2.2.5.5.3.1.1.5.' . $index,
'ciscosat',
++$dbindex,
'C/N Ratio ' .$index,
'ciscosat-cn-ratio',
$index,
'C/N Ratio ' . $index,
$entry
)
);
}
return $snrstatus;
return $sensors;
}
}
+6 -6
View File
@@ -273,7 +273,7 @@
"sensor_deleted": 0,
"sensor_class": "snr",
"sensor_index": "1",
"sensor_type": "ciscosat",
"sensor_type": "ciscosat-cn-margin",
"sensor_descr": "C/N Link Margin 1",
"sensor_divisor": 1,
"sensor_multiplier": 1,
@@ -293,8 +293,8 @@
{
"sensor_deleted": 0,
"sensor_class": "snr",
"sensor_index": "2",
"sensor_type": "ciscosat",
"sensor_index": "1",
"sensor_type": "ciscosat-cn-ratio",
"sensor_descr": "C/N Ratio 1",
"sensor_divisor": 1,
"sensor_multiplier": 1,
@@ -361,7 +361,7 @@
"sensor_deleted": 0,
"sensor_class": "snr",
"sensor_index": "1",
"sensor_type": "ciscosat",
"sensor_type": "ciscosat-cn-margin",
"sensor_descr": "C/N Link Margin 1",
"sensor_divisor": 1,
"sensor_multiplier": 1,
@@ -381,8 +381,8 @@
{
"sensor_deleted": 0,
"sensor_class": "snr",
"sensor_index": "2",
"sensor_type": "ciscosat",
"sensor_index": "1",
"sensor_type": "ciscosat-cn-ratio",
"sensor_descr": "C/N Ratio 1",
"sensor_divisor": 1,
"sensor_multiplier": 1,