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(parse_errors command): fix mibs directory specification for parse_errors command #1135

Merged
merged 2 commits into from
Mar 19, 2024

Conversation

kennyfellows
Copy link
Contributor

@kennyfellows kennyfellows commented Mar 14, 2024

@SuperQ, this PR fixes an issue where the parse_errors command was not finding the ./mibs directory, therefore preventing the parse_errors command from working properly. This fix also adds support for manually specifying the mibs directory via the -m flag in the parse_errors command.

Context

Previously, the parse_errors command was not correctly finding the default mibs directory, nor did it allow the user to manually specify a mibs directory.

The make generate (or generator generate after building) works by defaulting to the sibling ./mibs directory, but make parse_errors (or generator parse_errors) does not. The reason for this, is because the command line parser will interpret an omitted flag as an empty string. So this line, when running the generate command, is evaluating to a length of 1 with an empty string, therefore defaulting to the C.netsnmp_get_mib_directory(). But since this flag wasn't enable for the parse_errors command, that same line was evaluating to a length of 0, and no default was being returned.

@kennyfellows kennyfellows force-pushed the enable-m-flag-for-parse_errors branch from 07fe6df to 7de3de7 Compare March 14, 2024 20:34
…y Fellows <kennyfellows@gmail.com>

Signed-off-by: Kenneth Fellows <kennyfellows@gmail.com>
@kennyfellows kennyfellows force-pushed the enable-m-flag-for-parse_errors branch from 7de3de7 to 435283f Compare March 14, 2024 20:35
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.

Oh, good catch. Thanks.

FYI, the generator test error is unrelated, I have an open PR to fix a MIB downoad.

@SuperQ SuperQ merged commit 733e5a1 into prometheus:main Mar 19, 2024
6 checks passed
@SuperQ SuperQ mentioned this pull request May 10, 2024
SuperQ pushed a commit that referenced this pull request May 11, 2024
* [CHANGE] Improve generator parse error handling #1167
* [ENHANCEMENT] generator: Add generator HELP override #1106
* [ENHANCEMENT] Refactoring of Scrape process, fixing multiple module issues #1111
* [ENHANCEMENT] Skip using an interactive terminal in "make docker-generate". #1113
* [ENHANCEMENT] Add SNMPInflight metric #1119
* [FEATURE] Support for passing username, password & priv_password as env vars #1074
* [FEATURE] Add GoSNMP logger #1157
* [FEATURE] Add a "snmp_context" parameter to the URL #1163
* [BUGFIX] generator: curl failed #1094
* [BUGFIX] Fix SNMPv3 password configuration #1122
* [BUGFIX] generator: Update generator User-Agent #1133
* [BUGFIX] generator: fix mibs directory specification for parse_errors command #1135
* [BUGFIX] generator: remove extra character from dell iDrac-SMIv1 MIB #1141
* [BUGFIX] Fix do not expand envvars for empty config fields #1148

snmp.yml changes:
* Updated Cisco MIBs #1180
* Updated Cyberpower MIBs #1124
* Updated servertech_sentry3 #1090
* Added support for Dell iDrac  #1125
---------

Signed-off-by: Sebastian Schubert <basti@schubert.digital>
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

2 participants