2019-03-04 17:08:11 -05:00
|
|
|
<?php
|
2019-03-04 21:12:12 -06:00
|
|
|
|
2019-03-04 17:08:11 -05:00
|
|
|
namespace LibreNMS\OS;
|
|
|
|
|
|
|
|
use LibreNMS\Device\WirelessSensor;
|
|
|
|
use LibreNMS\Interfaces\Discovery\Sensors\WirelessErrorsDiscovery;
|
|
|
|
use LibreNMS\Interfaces\Discovery\Sensors\WirelessRssiDiscovery;
|
|
|
|
use LibreNMS\Interfaces\Discovery\Sensors\WirelessSnrDiscovery;
|
|
|
|
use LibreNMS\OS;
|
|
|
|
|
|
|
|
class Ciscosat extends OS implements WirelessErrorsDiscovery, WirelessRssiDiscovery, WirelessSnrDiscovery
|
|
|
|
{
|
|
|
|
public function discoverWirelessErrors()
|
|
|
|
{
|
2020-09-18 08:12:07 -05:00
|
|
|
$oids = snmpwalk_cache_oid($this->getDeviceArray(), 'satSignalUncorErrCnt', [], 'CISCO-DMN-DSG-TUNING-MIB', null, '-Ob');
|
2019-03-04 21:12:12 -06:00
|
|
|
$sensors = [];
|
2019-03-04 17:08:11 -05:00
|
|
|
foreach ($oids as $index => $entry) {
|
|
|
|
$sensors[] = new WirelessSensor(
|
|
|
|
'errors',
|
|
|
|
$this->getDeviceId(),
|
|
|
|
'.1.3.6.1.4.1.1429.2.2.5.5.3.1.1.12.' . $index,
|
|
|
|
'ciscosat',
|
|
|
|
$index,
|
|
|
|
'Uncorrected Errors ' . $index
|
|
|
|
);
|
|
|
|
}
|
2020-09-21 14:54:51 +02:00
|
|
|
|
2019-03-04 17:08:11 -05:00
|
|
|
return $sensors;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function discoverWirelessRssi()
|
|
|
|
{
|
2020-09-18 08:12:07 -05:00
|
|
|
$oids = snmpwalk_cache_oid($this->getDeviceArray(), 'satSignalLevel', [], 'CISCO-DMN-DSG-TUNING-MIB', null, '-Ob');
|
2019-03-04 21:12:12 -06:00
|
|
|
$sensors = [];
|
2019-03-04 17:08:11 -05:00
|
|
|
foreach ($oids as $index => $entry) {
|
|
|
|
$sensors[] = new WirelessSensor(
|
|
|
|
'rssi',
|
|
|
|
$this->getDeviceId(),
|
|
|
|
'.1.3.6.1.4.1.1429.2.2.5.5.3.1.1.7.' . $index,
|
|
|
|
'ciscosat',
|
|
|
|
$index,
|
2019-03-04 21:12:12 -06:00
|
|
|
'Receive Signal Level ' . $index
|
2019-03-04 17:08:11 -05:00
|
|
|
);
|
|
|
|
}
|
2020-09-21 14:54:51 +02:00
|
|
|
|
2019-03-04 17:08:11 -05:00
|
|
|
return $sensors;
|
|
|
|
}
|
2019-03-04 21:12:12 -06:00
|
|
|
|
2019-03-04 17:08:11 -05:00
|
|
|
public function discoverWirelessSnr()
|
|
|
|
{
|
2019-03-04 21:12:12 -06:00
|
|
|
$sensors = [];
|
|
|
|
|
|
|
|
// snr - Discover C/N Link Margin
|
2020-09-18 08:12:07 -05:00
|
|
|
$cnmargin = snmpwalk_cache_oid($this->getDeviceArray(), 'satSignalCnMargin', [], 'CISCO-DMN-DSG-TUNING-MIB', null, '-OQUsb');
|
2019-03-04 17:08:11 -05:00
|
|
|
foreach ($cnmargin as $index => $entry) {
|
2019-03-04 21:12:12 -06:00
|
|
|
$sensors[] = new WirelessSensor(
|
2019-03-04 17:08:11 -05:00
|
|
|
'snr',
|
|
|
|
$this->getDeviceId(),
|
|
|
|
'.1.3.6.1.4.1.1429.2.2.5.5.3.1.1.6.' . $index,
|
2019-03-04 21:12:12 -06:00
|
|
|
'ciscosat-cn-margin',
|
|
|
|
$index,
|
|
|
|
'C/N Link Margin ' . $index,
|
2019-03-04 17:08:11 -05:00
|
|
|
$entry
|
|
|
|
);
|
|
|
|
}
|
2019-03-04 21:12:12 -06:00
|
|
|
|
|
|
|
// snr - Discover C/N Ratio
|
2020-09-18 08:12:07 -05:00
|
|
|
$cnratio = snmpwalk_cache_oid($this->getDeviceArray(), 'satSignalCndisp', [], 'CISCO-DMN-DSG-TUNING-MIB', null, '-OQUsb');
|
2019-03-04 17:08:11 -05:00
|
|
|
foreach ($cnratio as $index => $entry) {
|
2019-03-04 21:12:12 -06:00
|
|
|
$sensors[] = new WirelessSensor(
|
2019-03-04 17:08:11 -05:00
|
|
|
'snr',
|
|
|
|
$this->getDeviceId(),
|
|
|
|
'.1.3.6.1.4.1.1429.2.2.5.5.3.1.1.5.' . $index,
|
2019-03-04 21:12:12 -06:00
|
|
|
'ciscosat-cn-ratio',
|
|
|
|
$index,
|
|
|
|
'C/N Ratio ' . $index,
|
2019-03-04 17:08:11 -05:00
|
|
|
$entry
|
|
|
|
);
|
|
|
|
}
|
2020-09-21 14:54:51 +02:00
|
|
|
|
2019-03-04 21:12:12 -06:00
|
|
|
return $sensors;
|
2019-03-04 17:08:11 -05:00
|
|
|
}
|
|
|
|
}
|