Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VRP NAC polling optimisation #12279

Merged
merged 2 commits into from Nov 8, 2020
Merged

Conversation

PipoCanaja
Copy link
Contributor

Instead of polling a very large table for only a part of the OIDs, we only walk the OIDs we need.
11 small snmpwalk_cache_oids calls instead of 2 big ones.

6 seconds instead of 20 seconds on my stacks.

Please give a short description what your pull request is for

DO NOT DELETE THE UNDERLYING TEXT

Please note

Please read this information carefully. You can run ./lnms dev:check to check your code before submitting.

  • Have you followed our code guidelines?
  • If my Pull Request does some changes/fixes/enhancements in the WebUI, I have inserted a screenshot of it.

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.

@PipoCanaja PipoCanaja self-assigned this Oct 29, 2020
@PipoCanaja PipoCanaja marked this pull request as ready for review October 29, 2020 22:26
'hwAccessVLANID',
];
foreach ($hwAccessOids as $hwAccessOid) {
$portAuthSessionEntry = snmpwalk_cache_oid($this->getDeviceArray(), $hwAccessOid, $portAuthSessionEntry, 'HUAWEI-AAA-MIB');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might be missing something but isn't this just overwriting $portAuthSessionEntry over Again?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

snmpwalk_cache_oid is populating the input array (3rd parameter) and returning the result. So $portAuthSessionEntry after the loop filled with all the values.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh. My bad. Can't we use one of the "multi" functions here instead tho?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The multi functions are only for snmpget calls. snmpwalk does not support multi OIDs.

@murrant murrant merged commit 2b5da1e into librenms:master Nov 8, 2020
@murrant
Copy link
Member

murrant commented Dec 2, 2020

This pull request has been mentioned on LibreNMS Community. There might be relevant details there:

https://community.librenms.org/t/v1-69-release-changelog-november-2020/14124/1

@PipoCanaja PipoCanaja deleted the vrp-nac-opt branch March 6, 2021 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants