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

snmp ip/mac addr conversion & oid index suffix support #1784

Merged
merged 3 commits into from
Sep 27, 2016
Merged

snmp ip/mac addr conversion & oid index suffix support #1784

merged 3 commits into from
Sep 27, 2016

Conversation

phemmer
Copy link
Contributor

@phemmer phemmer commented Sep 18, 2016

This adds 2 new features to the SNMP plugin:

  1. Support for MAC address & IP address conversion. Both types of addresses, when returned as packed bytes, can be converted to human readable addresses.
  2. Support for OID index suffixes. When joining multiple tables, sometimes the joined table has a slightly longer index as the table has a multiple records for each of the records in the origin table. The new oid_index_suffix allows stripping off the trailing part of the OID on the joined table so that the index will match.

closes #1755
closes #1729

Required for all PRs:

  • CHANGELOG.md updated (we recommend not updating this until the PR has been approved by a maintainer)
  • Sign CLA (if not already signed)

@@ -0,0 +1,97 @@
// +build generate
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I built this generator to make management of the mocked commands easier. Having to manually add the command & output to the test file was becoming a PITA.

@@ -0,0 +1,82 @@
package snmp
Copy link
Contributor Author

@phemmer phemmer Sep 18, 2016

Choose a reason for hiding this comment

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

I split all the command mocking stuff out of test_snmp.go to keep the tests clean.

@phemmer
Copy link
Contributor Author

phemmer commented Sep 18, 2016

@mattbakerau This should solve your use case (#1729). If you want to take a look at it, and/or try it out, any feedback would be great.

@mnctech This should also solve your use case (#1755). If you have any feedback, it would also be appreciated.

@nhaugo nhaugo added this to the 1.1.0 milestone Sep 21, 2016
Copy link
Contributor

@sparrc sparrc left a comment

Choose a reason for hiding this comment

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

LGTM, I can merge when you rebase the changes

Also consolidated the translation code to obtain all info with just 1 command execution.

Also split test command mocks out to their own file for cleanliness.
@phemmer
Copy link
Contributor Author

phemmer commented Sep 26, 2016

Rebased

@sparrc sparrc merged commit 055ef16 into influxdata:master Sep 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SNMP plugin IF-MIB::ifTable physical interface problem SNMP plugin mapping
3 participants