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

refactor: Update some snmpwalks for ports polling to improve speed #6341

Merged
merged 1 commit into from Apr 5, 2017

Conversation

Projects
None yet
5 participants
@laf
Member

laf commented Apr 4, 2017

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.

  • Have you signed the Contributors agreement - please do NOT submit a pull request unless you have (signing the agreement in the same pull request is fine). Your commit message for signing the agreement must appear as per the docs.
  • Have you followed our 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

I'll do some inline comments on this one but for me it drops port polling on Arista down from 160 -> 80 seconds. It also helps our Cisco switches, with about 800 devices I've dropped 20 seconds on each distributed poller.

@mention-bot

This comment has been minimized.

Show comment
Hide comment
@mention-bot

mention-bot Apr 4, 2017

Thank you for submitting a PR @laf! We have found the following @BarbarossaTM, @murrant and @ekoyle based on the history of these files to review this PR.

mention-bot commented Apr 4, 2017

Thank you for submitting a PR @laf! We have found the following @BarbarossaTM, @murrant and @ekoyle based on the history of these files to review this PR.

@@ -66,23 +66,6 @@
'ifOutMulticastPkts',
);
// From above for DB
$etherlike_oids = array(

This comment has been minimized.

@laf

laf Apr 4, 2017

Member

We appear to not use these at all.

@laf

laf Apr 4, 2017

Member

We appear to not use these at all.

@@ -224,11 +210,11 @@
}
}
if ($config['enable_ports_etherlike']) {
echo 'dot3Stats ';
$port_stats = snmpwalk_cache_oid($device, 'dot3StatsEntry', $port_stats, 'EtherLike-MIB');

This comment has been minimized.

@laf

laf Apr 4, 2017

Member

We don't use any of this table.

@laf

laf Apr 4, 2017

Member

We don't use any of this table.

echo 'dot3StatsDuplexStatus';
if ($config['enable_ports_poe'] || $config['enable_ports_etherlike']) {
$port_stats = snmpwalk_cache_oid($device, 'dot3StatsIndex', $port_stats, 'EtherLike-MIB');

This comment has been minimized.

@laf

laf Apr 4, 2017

Member

We use only this + dot3StatsDuplexStatus within poe and etherlike port polling files so only look those up.

@laf

laf Apr 4, 2017

Member

We use only this + dot3StatsDuplexStatus within poe and etherlike port polling files so only look those up.

if ($device['os_group'] == 'cisco' && $device['os'] != 'asa') {
foreach ($pagp_oids as $oid) {
$port_stats = snmpwalk_cache_oid($device, $oid, $port_stats, 'CISCO-PAGP-MIB');
$pagp_port_stats = snmpwalk_cache_oid($device, $oid, array(), 'CISCO-PAGP-MIB');

This comment has been minimized.

@laf

laf Apr 4, 2017

Member

Later on we only use the check for pagpOperationMode so we poll that first, check it has data and if so apply it to $port_stats and then poll the rest of pagp data.

@laf

laf Apr 4, 2017

Member

Later on we only use the check for pagpOperationMode so we poll that first, check it has data and if so apply it to $port_stats and then poll the rest of pagp data.

@@ -280,7 +270,7 @@
$port_stats = snmpwalk_cache_oid($device, 'vlanTrunkPortEncapsulationOperType', $port_stats, 'CISCO-VTP-MIB');
$port_stats = snmpwalk_cache_oid($device, 'vlanTrunkPortNativeVlan', $port_stats, 'CISCO-VTP-MIB');
} elseif ($device['os'] != 'asa') {
$port_stats = snmpwalk_cache_oid($device, 'dot1qPortVlanTable', $port_stats, 'Q-BRIDGE-MIB');
$port_stats = snmpwalk_cache_oid($device, 'dot1qPvid', $port_stats, 'Q-BRIDGE-MIB');

This comment has been minimized.

@laf

laf Apr 4, 2017

Member

We only used dot1qPvid out of the entire table!

@laf

laf Apr 4, 2017

Member

We only used dot1qPvid out of the entire table!

@laf

This comment has been minimized.

Show comment
Hide comment
@laf

laf Apr 4, 2017

Member

Comments on both old and new changes in: https://github.com/librenms/librenms/pull/6341/files

Member

laf commented Apr 4, 2017

Comments on both old and new changes in: https://github.com/librenms/librenms/pull/6341/files

@LibreNMS-CI

This comment has been minimized.

Show comment
Hide comment
@LibreNMS-CI

LibreNMS-CI commented Apr 4, 2017

Auto-Deploy finished, Test PR at http://6341.ci.librenms.org or https://6341.ci.librenms.org

@scrutinizer-notifier

This comment has been minimized.

Show comment
Hide comment
@scrutinizer-notifier

scrutinizer-notifier Apr 4, 2017

The inspection completed: No new issues

scrutinizer-notifier commented Apr 4, 2017

The inspection completed: No new issues

@murrant

This comment has been minimized.

Show comment
Hide comment
@murrant

murrant Apr 4, 2017

Member

@laf Looks nice! Not sure when I will have time to test...

Member

murrant commented Apr 4, 2017

@laf Looks nice! Not sure when I will have time to test...

@laf

This comment has been minimized.

Show comment
Hide comment
@laf

laf Apr 4, 2017

Member

You can have faith :)

Member

laf commented Apr 4, 2017

You can have faith :)

@murrant

This comment has been minimized.

Show comment
Hide comment
@murrant

murrant Apr 5, 2017

Member

I have faith, but for some portions of the code I require myself to test before approving ;)

Member

murrant commented Apr 5, 2017

I have faith, but for some portions of the code I require myself to test before approving ;)

@murrant

murrant approved these changes Apr 5, 2017

@laf

This comment has been minimized.

Show comment
Hide comment
@laf

laf Apr 5, 2017

Member

Wimp :D

Member

laf commented Apr 5, 2017

Wimp :D

@murrant

murrant approved these changes Apr 5, 2017

Running on production, looks good.

@laf laf merged commit da68e50 into librenms:master Apr 5, 2017

2 checks passed

Auto-Deploy Build finished.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@laf laf deleted the laf:ports-polling-perf branch Apr 5, 2017

@laf laf referenced this pull request May 5, 2017

Closed

Cisco PAgP Polling Cleanup #4775

@lock lock bot locked as resolved and limited conversation to collaborators May 19, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.