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

feature: New snmpwalk_group() function #6865

Merged
merged 2 commits into from Jun 23, 2017

Conversation

Projects
None yet
4 participants
@murrant
Member

murrant commented Jun 19, 2017

Intended to replace several other snmp functions, but may not behave exactly as they did.
Properly handles multi-line values.
Adds additional index data after the grouping so it isn't lost. Perhaps might make optional.
Might add $skip variable to support fully numeric oid indexes. Thoughts?

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.

Testers

If you would like to test this pull request then please run: ./scripts/github-apply <pr_id>, i.e ./scripts/github-apply 5926

feature: New snmpwalk_group() function
Intended to replace several other snmp functions, but may not behave exactly as they did.
Properly handles multi-line values.
Adds additional index data after the grouping so it isn't lost. Perhaps might make optional.
Might add $skip variable to support fully numeric oid indexes. Thoughts?
@LibreNMS-CI

This comment has been minimized.

Show comment
Hide comment
Show outdated Hide outdated includes/snmp.inc.php
*/
function snmpwalk_group($device, $oid, $mib = '', $depth = 1, $array = array())
{
$cmd = gen_snmpwalk_cmd($device, $oid, '-OQUsb', $mib);

This comment has been minimized.

@laf

laf Jun 21, 2017

Member

Setting the flags statically can be a problem. I set OeQUs in the sensors yaml pr as we need e mainly to print the data unparsed by the mib. this is used for state translations so you get back 4 instead of noError.

@laf

laf Jun 21, 2017

Member

Setting the flags statically can be a problem. I set OeQUs in the sensors yaml pr as we need e mainly to print the data unparsed by the mib. this is used for state translations so you get back 4 instead of noError.

This comment has been minimized.

@murrant

murrant Jun 21, 2017

Member

The snmpwalk_cache_oid functions don't allow options.

I could allow options but I would need to filter them.

Or we could come up with a really good default and force the use of other snmpwalk if custom options are needed.

@murrant

murrant Jun 21, 2017

Member

The snmpwalk_cache_oid functions don't allow options.

I could allow options but I would need to filter them.

Or we could come up with a really good default and force the use of other snmpwalk if custom options are needed.

This comment has been minimized.

@laf

laf Jun 21, 2017

Member

It does:

snmpwalk_cache_oid($device, $oid, $array, $mib = null, $mibdir = null, $snmpflags = '-OQUs')

Maybe if you just add e to that default list if you don't want to accept the options.

@laf

laf Jun 21, 2017

Member

It does:

snmpwalk_cache_oid($device, $oid, $array, $mib = null, $mibdir = null, $snmpflags = '-OQUs')

Maybe if you just add e to that default list if you don't want to accept the options.

@scrutinizer-notifier

This comment has been minimized.

Show comment
Hide comment
@scrutinizer-notifier

scrutinizer-notifier Jun 22, 2017

The inspection completed: 3 updated code elements

The inspection completed: 3 updated code elements

@laf laf merged commit 1c43fec into librenms:master Jun 23, 2017

2 of 3 checks passed

Auto-Deploy Build finished.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
license/cla Contributor License Agreement is signed.
Details

@murrant murrant deleted the murrant:snmpwalk-group branch Jun 24, 2017

@lock

This comment has been minimized.

Show comment
Hide comment
@lock

lock bot May 17, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed.

lock bot commented May 17, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed.

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

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