mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
initialize arrays before loops so that they are not overwritten, but are appended in each iteration.
This commit is contained in:
@@ -23,22 +23,26 @@ if ($device['type'] == 'wireless' && $device['os'] == 'arubaos') {
|
|||||||
$switch_apname_oids = array('wlsxWlanRadioEntry.16');
|
$switch_apname_oids = array('wlsxWlanRadioEntry.16');
|
||||||
|
|
||||||
|
|
||||||
|
// initialize arrays to avoid overwriting them in foreach loops below
|
||||||
|
$aruba_stats = array();
|
||||||
|
$aruba_apstats = array();
|
||||||
|
$aruba_apnames = array();
|
||||||
|
|
||||||
$aruba_oids = array_merge($switch_info_oids, $switch_counter_oids);
|
$aruba_oids = array_merge($switch_info_oids, $switch_counter_oids);
|
||||||
echo 'Caching Oids: ';
|
echo 'Caching Oids: ';
|
||||||
foreach ($aruba_oids as $oid) {
|
foreach ($aruba_oids as $oid) {
|
||||||
echo "$oid ";
|
echo "$oid ";
|
||||||
$aruba_stats = snmpwalk_cache_oid($device, $oid, array(), 'WLSX-SWITCH-MIB');
|
$aruba_stats = snmpwalk_cache_oid($device, $oid, $aruba_stats, 'WLSX-SWITCH-MIB');
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($switch_apinfo_oids as $oid) {
|
foreach ($switch_apinfo_oids as $oid) {
|
||||||
echo "$oid ";
|
echo "$oid ";
|
||||||
$aruba_apstats = snmpwalk_cache_oid_num($device, $oid, array(), 'WLSX-WLAN-MIB');
|
$aruba_apstats = snmpwalk_cache_oid_num($device, $oid, $aruba_apstats, 'WLSX-WLAN-MIB');
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($switch_apname_oids as $oid) {
|
foreach ($switch_apname_oids as $oid) {
|
||||||
echo "$oid ";
|
echo "$oid ";
|
||||||
$aruba_apnames = snmpwalk_cache_oid_num($device, $oid, array(), 'WLSX-WLAN-MIB');
|
$aruba_apnames = snmpwalk_cache_oid_num($device, $oid, $aruba_apnames, 'WLSX-WLAN-MIB');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user