Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Aruba Instant wireless sensors #9936

Merged
merged 2 commits into from Mar 13, 2019
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

Next

fix Aruba Instant wireless sensors

  • Loading branch information...
murrant committed Mar 12, 2019
commit 07949050bdbb52f00f7a35aaad0a1db3eb1a4658
@@ -51,9 +51,9 @@ class Arubaos extends OS implements
public function discoverWirelessClients()
{
$oid = '.1.3.6.1.4.1.14823.2.2.1.1.3.2'; // WLSX-SWITCH-MIB::wlsxSwitchTotalNumStationsAssociated
return array(
return [
new WirelessSensor('clients', $this->getDeviceId(), $oid, 'arubaos', 1, 'Clients')
);
];
}
/**
@@ -99,28 +99,25 @@ protected function decodeChannel($channel)
private function discoverInstantRadio($type, $oid, $desc = 'Radio %s')
{
$data = snmpwalk_cache_oid_num($this->getDevice(), $oid, array(), 'AI-AP-MIB');
$data = snmpwalk_cache_numerical_oid($this->getDevice(), $oid, [], 'AI-AP-MIB');
$sensors = array();
foreach ($data as $oid => $entry) {
$oid_parts = explode('.', $oid);
$index = end($oid_parts);
$tmp_index = "$oid.$index";
$sensors = [];
foreach ($data as $index => $entry) {
$value = reset($entry);
$oid = key($entry);
if ($type == 'frequency') {
$current = WirelessSensor::channelToFrequency($this->decodeChannel($entry[$oid]));
} else {
$current = $entry[$oid];
$value = WirelessSensor::channelToFrequency($this->decodeChannel($value));
}
$sensors[] = new WirelessSensor(
$type,
$this->getDeviceId(),
$oid,
'arubaos-iap',
$tmp_index,
$oid,
sprintf($desc, $index),
$current
$value
);
}
@@ -148,6 +145,6 @@ public function discoverWirelessUtilization()
*/
public function pollWirelessFrequency(array $sensors)
{
return $this->pollWirelessChannelAsFrequency($sensors, array($this, 'decodeChannel'));
return $this->pollWirelessChannelAsFrequency($sensors, [$this, 'decodeChannel']);
}
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.