mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
newdevice: Added RSSI Support for Cisco IOS wireless devices (#7147)
This commit is contained in:
@ -27,9 +27,12 @@ namespace LibreNMS\OS;
|
||||
|
||||
use LibreNMS\Device\WirelessSensor;
|
||||
use LibreNMS\Interfaces\Discovery\Sensors\WirelessClientsDiscovery;
|
||||
use LibreNMS\Interfaces\Discovery\Sensors\WirelessRssiDiscovery;
|
||||
use LibreNMS\OS;
|
||||
|
||||
class Ios extends OS implements WirelessClientsDiscovery
|
||||
class Ios extends OS implements
|
||||
WirelessClientsDiscovery,
|
||||
WirelessRssiDiscovery
|
||||
{
|
||||
/**
|
||||
* @return array Sensors
|
||||
@ -84,4 +87,28 @@ class Ios extends OS implements WirelessClientsDiscovery
|
||||
}
|
||||
return $sensors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Discover wireless RSSI (Received Signal Strength Indicator). This is in dBm. Type is rssi.
|
||||
* Returns an array of LibreNMS\Device\Sensor objects that have been discovered
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function discoverWirelessRssi()
|
||||
{
|
||||
$data = snmpwalk_cache_oid($this->getDevice(), 'c3gCurrentGsmRssi', array(), 'CISCO-WAN-3G-MIB');
|
||||
foreach ($data as $index => $entry) {
|
||||
$sensors[] = new WirelessSensor(
|
||||
'rssi',
|
||||
$this->getDeviceId(),
|
||||
'.1.3.6.1.4.1.9.9.661.1.3.4.1.1.1.' . $index,
|
||||
'ios',
|
||||
$index,
|
||||
'RSSI: Chain ' . str_replace('1.', '', $index),
|
||||
$entry['c3gCurrentGsmRssi.1']
|
||||
);
|
||||
}
|
||||
|
||||
return $sensors;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user