From 2b5da1ef05eae67b79d9d91e7a02611b39ed0c8f Mon Sep 17 00:00:00 2001 From: PipoCanaja <38363551+PipoCanaja@users.noreply.github.com> Date: Sun, 8 Nov 2020 05:31:04 +0100 Subject: [PATCH] VRP NAC polling optimisation (#12279) * Only poll the OIDs needed * style --- LibreNMS/OS/Vrp.php | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/LibreNMS/OS/Vrp.php b/LibreNMS/OS/Vrp.php index e52be0cac2..f9d9482db5 100644 --- a/LibreNMS/OS/Vrp.php +++ b/LibreNMS/OS/Vrp.php @@ -298,11 +298,26 @@ class Vrp extends OS implements { $nac = collect(); // We collect the first table - $portAuthSessionEntry = snmpwalk_cache_oid($this->getDeviceArray(), 'hwAccessTable', [], 'HUAWEI-AAA-MIB'); + $portAuthSessionEntry = snmpwalk_cache_oid($this->getDeviceArray(), 'hwAccessInterface', [], 'HUAWEI-AAA-MIB'); if (! empty($portAuthSessionEntry)) { - // If it is not empty, lets add the Extended table - $portAuthSessionEntry = snmpwalk_cache_oid($this->getDeviceArray(), 'hwAccessExtTable', $portAuthSessionEntry, 'HUAWEI-AAA-MIB'); + // If it is not empty, lets add all the necessary OIDs + $hwAccessOids = [ + 'hwAccessMACAddress', + 'hwAccessDomain', + 'hwAccessUserName', + 'hwAccessIPAddress', + 'hwAccessType', + 'hwAccessAuthorizetype', + 'hwAccessSessionTimeout', + 'hwAccessOnlineTime', + 'hwAccessCurAuthenPlace', + 'hwAccessAuthtype', + 'hwAccessVLANID', + ]; + foreach ($hwAccessOids as $hwAccessOid) { + $portAuthSessionEntry = snmpwalk_cache_oid($this->getDeviceArray(), $hwAccessOid, $portAuthSessionEntry, 'HUAWEI-AAA-MIB'); + } // We cache a port_ifName -> port_id map $ifName_map = $this->getDevice()->ports()->pluck('port_id', 'ifName');