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:
Tony Murray
2017-05-04 02:04:13 -05:00
committed by Neil Lathwood
parent 5ca07e11aa
commit 418d2c8fef

View File

@@ -49,11 +49,27 @@ class Routeros extends OS implements
*/
public function discoverWirelessCcq()
{
return $this->discoverSensor(
'ccq',
'mtxrWlApOverallTxCCQ',
'.1.3.6.1.4.1.14988.1.1.1.3.1.10.'
);
$data = $this->fetchData();
$sensors = array();
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;
}
/**