From 2370c08cbde6ee6884df7719b23ed36278bc80ff Mon Sep 17 00:00:00 2001 From: Neil Lathwood Date: Sat, 12 Aug 2017 21:54:50 +0100 Subject: [PATCH] newdevice: Added RSSI Support for Cisco IOS wireless devices (#7147) --- LibreNMS/OS/Ios.php | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/LibreNMS/OS/Ios.php b/LibreNMS/OS/Ios.php index cd44c3c535..ab505690aa 100644 --- a/LibreNMS/OS/Ios.php +++ b/LibreNMS/OS/Ios.php @@ -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; + } }