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

Fix generator lookups to match OIDs closer to the index OID. #828

Merged
merged 7 commits into from Oct 28, 2023

Conversation

stephan-windischmann-sky
Copy link
Contributor

When running the configuration generator with lookups were multilpe different nodes have the same label the generator was always grabbing the OID of the last MIB that was parsed.

I modified the lookup mechanism to first attempt to match the lookup node so that the OID matches that of the metric in all but the last branch.
In case no match is found, it reverts to the old behavior.

…label

Signed-off-by: Windischmann, Stephan <stephan.windischmann@sky.uk>
@SuperQ
Copy link
Member

SuperQ commented Jul 1, 2023

Interesting, can you point to any specific OIDs where this changes things?

@stephan-windischmann-sky
Copy link
Contributor Author

Interesting, can you point to any specific OIDs where this changes things?

I have attached the MIB with which we noticed the issue.
mibs-vss47.zip

As an example, both SYMSOFT-SS7FILTER-0-MIB.txt and SYMSOFT-TRAFFICSIMULATOR-0-MIB.txt both have nodes with the label layerName. This is used to lookup a human readable name.
WIth the upstream code, all lookups went to the last layerName node that was parsed instead of to the layerName node belonging to the same level.

@SuperQ
Copy link
Member

SuperQ commented Jul 3, 2023

Interesting, I was hoping this would fix the conflict in ifDescr lookups between IF-MIB and PaloAlto PAN-COMMON-MIB. But it doesn't seem to help

@SuperQ
Copy link
Member

SuperQ commented Sep 2, 2023

It looks like this affects the raritan module. Does the output change look right to you? Would you mind updating the snmp.yml so the generator test passes?

Copy link
Member

@SuperQ SuperQ left a comment

Choose a reason for hiding this comment

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

This needs an update to the snmp.yml.

Signed-off-by: stephan-windischmann-sky <120649376+stephan-windischmann-sky@users.noreply.github.com>
@stephan-windischmann-sky
Copy link
Contributor Author

The changes in snmp.yml look good to me. Thanks.

@SuperQ
Copy link
Member

SuperQ commented Oct 27, 2023

Yikes, it looks like the git history got messed up.

Signed-off-by: Stephan Windischmann <windi@Stephans-MacBook-Pro.local>
@stephan-windischmann-sky
Copy link
Contributor Author

Fixed git messup. snmp.yml is updated.

@SuperQ SuperQ changed the title Update lookup mechanism in configuration generator Fix generator lookups to match OIDs closer to the index OID. Oct 28, 2023
@SuperQ
Copy link
Member

SuperQ commented Oct 28, 2023

Nice, thanks.

@SuperQ SuperQ merged commit f427269 into prometheus:main Oct 28, 2023
6 checks passed
SuperQ added a commit that referenced this pull request Nov 24, 2023
* [ENHANCEMENT] generator: Add support for subsequent address family #782
* [ENHANCEMENT] generator: Fix lookups to match OIDs closer to the index OID. #828
* [FEATURE] Add a scaling factor #1026
* [FEATURE] generator: Enable passing input file, output file, and mibs dir as flags #1028
* [FEATURE] Add an offset factor #1029
* [BUGFIX] Fix and optimize generator Docker image building #1045

snmp.yml changes:

* Override `bsnAPName` to DisplayString #660
* Import TP-Link EAP MIB  #833
* Updated Mikrotik neighbor indexes make them unique #986
* Update PowerNet MIB to v4.5.1 #1003
* Refactor HOST-RESOURCES-MIB #1027
* Update keepalived MIB files to latest version #1044

Signed-off-by: SuperQ <superq@gmail.com>
@SuperQ SuperQ mentioned this pull request Nov 24, 2023
SuperQ added a commit that referenced this pull request Nov 26, 2023
* [ENHANCEMENT] generator: Add support for subsequent address family #782
* [ENHANCEMENT] generator: Fix lookups to match OIDs closer to the index OID. #828
* [FEATURE] Add a scaling factor #1026
* [FEATURE] generator: Enable passing input file, output file, and mibs dir as flags #1028
* [FEATURE] Add an offset factor #1029
* [BUGFIX] Fix and optimize generator Docker image building #1045

snmp.yml changes:

* Override `bsnAPName` to DisplayString #660
* Import TP-Link EAP MIB  #833
* Updated Mikrotik neighbor indexes make them unique #986
* Update PowerNet MIB to v4.5.1 #1003
* Refactor HOST-RESOURCES-MIB #1027
* Update keepalived MIB files to latest version #1044

Signed-off-by: SuperQ <superq@gmail.com>
SuperQ added a commit that referenced this pull request Dec 6, 2023
* [ENHANCEMENT] generator: Add support for subsequent address family #782
* [ENHANCEMENT] generator: Fix lookups to match OIDs closer to the index OID. #828
* [FEATURE] Add a scaling factor #1026
* [FEATURE] generator: Enable passing input file, output file, and mibs dir as flags #1028
* [FEATURE] Add an offset factor #1029
* [BUGFIX] Fix and optimize generator Docker image building #1045

snmp.yml changes:

* Override `bsnAPName` to DisplayString #660
* Import TP-Link EAP MIB  #833
* Updated Mikrotik neighbor indexes make them unique #986
* Update PowerNet MIB to v4.5.1 #1003
* Refactor HOST-RESOURCES-MIB #1027
* Update keepalived MIB files to latest version #1044

Signed-off-by: SuperQ <superq@gmail.com>
SuperQ added a commit that referenced this pull request Dec 10, 2023
* [ENHANCEMENT] generator: Add support for subsequent address family #782
* [ENHANCEMENT] generator: Fix lookups to match OIDs closer to the index OID. #828
* [FEATURE] Add a scaling factor #1026
* [FEATURE] generator: Enable passing input file, output file, and mibs dir as flags #1028
* [FEATURE] Add an offset factor #1029
* [BUGFIX] Fix and optimize generator Docker image building #1045

snmp.yml changes:

* Override `bsnAPName` to DisplayString #660
* Import TP-Link EAP MIB  #833
* Updated Mikrotik neighbor indexes make them unique #986
* Update PowerNet MIB to v4.5.1 #1003
* Refactor HOST-RESOURCES-MIB #1027
* Update keepalived MIB files to latest version #1044

Signed-off-by: SuperQ <superq@gmail.com>
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.

None yet

3 participants