mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fix: RouterOS: don't detect ccq sensors when they aren't returning data (#6573)
If clients == 0, ccq is probably 0 too, but if there is a client and ccq is 0. The device is probably using nv2
This commit is contained in:
committed by
Neil Lathwood
parent
5ca07e11aa
commit
418d2c8fef
@@ -49,11 +49,27 @@ class Routeros extends OS implements
|
|||||||
*/
|
*/
|
||||||
public function discoverWirelessCcq()
|
public function discoverWirelessCcq()
|
||||||
{
|
{
|
||||||
return $this->discoverSensor(
|
$data = $this->fetchData();
|
||||||
'ccq',
|
|
||||||
'mtxrWlApOverallTxCCQ',
|
$sensors = array();
|
||||||
'.1.3.6.1.4.1.14988.1.1.1.3.1.10.'
|
foreach ($data as $index => $entry) {
|
||||||
);
|
// skip sensors with no data (nv2 should report 1 client, but doesn't report ccq)
|
||||||
|
if ($entry['mtxrWlApClientCount'] > 0 && $entry['mtxrWlApOverallTxCCQ'] == 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$sensors[] = new WirelessSensor(
|
||||||
|
'ccq',
|
||||||
|
$this->getDeviceId(),
|
||||||
|
'.1.3.6.1.4.1.14988.1.1.1.3.1.10.' . $index,
|
||||||
|
'mikrotik',
|
||||||
|
$index,
|
||||||
|
'SSID: ' . $entry['mtxrWlApSsid'],
|
||||||
|
$entry['mtxrWlApOverallTxCCQ']
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $sensors;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user