Files

82 lines
2.6 KiB
PHP
Raw Permalink Normal View History

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()
{
2019-03-04 21:12:12 -06:00
$oids = snmpwalk_cache_oid($this->getDevice(), 'satSignalUncorErrCnt', [], 'CISCO-DMN-DSG-TUNING-MIB', null, '-Ob');
$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
);
}
return $sensors;
}
public function discoverWirelessRssi()
{
2019-03-04 21:12:12 -06:00
$oids = snmpwalk_cache_oid($this->getDevice(), 'satSignalLevel', [], 'CISCO-DMN-DSG-TUNING-MIB', null, '-Ob');
$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
);
}
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
$cnmargin = snmpwalk_cache_oid($this->getDevice(), '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
$cnratio = snmpwalk_cache_oid($this->getDevice(), '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
);
}
2019-03-04 21:12:12 -06:00
return $sensors;
2019-03-04 17:08:11 -05:00
}
}