Removed unnecessary model checks in HiveOS Wireless (#9409)

DO NOT DELETE THIS TEXT

#### Please note

> Please read this information carefully. You can run `./scripts/pre-commit.php` to check your code before submitting.

- [x] Have you followed our [code guidelines?](http://docs.librenms.org/Developing/Code-Guidelines/)

#### Testers

If you would like to test this pull request then please run: `./scripts/github-apply <pr_id>`, i.e `./scripts/github-apply 5926`
After you are done testing, you can remove the changes with `./scripts/github-remove`.  If there are schema changes, you can ask on discord how to revert.
This commit is contained in:
theherodied
2018-11-08 17:25:04 -05:00
committed by Neil Lathwood
parent 76a38149ad
commit 31dfc1fad7

View File

@@ -17,25 +17,13 @@
*
* @package LibreNMS
* @link http://librenms.org
* @copyright 2015 Søren Friis Rosiak
* @author sorenrosiak@gmail.com
* @copyright 2018 Ryan Finney
* @author https://github.com/theherodied/
*/
if (preg_match('/^(.+?),/', $device['sysDescr'], $hardware)) {
$hardware = $store[1];
}
$hardware = trim(snmp_get($device, '.1.3.6.1.4.1.4413.1.1.1.1.1.3.0', '-Ovq'), '"');
$version = trim(snmp_get($device, '.1.3.6.1.4.1.4413.1.1.1.1.1.13.0', '-Ovq'), '"');
$serial = trim(snmp_get($device, '.1.3.6.1.4.1.4413.1.1.1.1.1.4.0', '-Ovq'), '"');
$apmodel = snmp_get($device, 'ahDeviceMode.0', '-Ovq', 'AH-SYSTEM-MIB');
if ($apmodel == 'AP130' || $apmodel == 'AP250' || $apmodel == 'AP550') {
$data = snmp_get_multi_oid($device, 'ahSystemSerial.0 ahDeviceMode.0 ahFirmwareVersion.0', '-OQUs', 'AH-SYSTEM-MIB');
$hardware = $data['ahDeviceMode.0'];
$version2 = $data['ahFirmwareVersion.0'];
// Version has 'HiveOS ' included. We want to remove it so OS doesn't show HiveOS twice.
$version = preg_replace('/^HiveOS /', '', $version2);
$serial = $data['ahSystemSerial.0'];
}
$data = snmp_get_multi_oid($device,'ahSystemSerial.0 ahDeviceMode.0 ahFirmwareVersion.0','-OQUs','AH-SYSTEM-MIB');
$hardware = $data['ahDeviceMode.0'];
$version2 = $data['ahFirmwareVersion.0'];
// Version has 'HiveOS ' included. We want to remove it so OS doesn't show HiveOS twice.
$version = preg_replace('/^HiveOS /','',$version2);
$serial = $data['ahSystemSerial.0'];