-
Notifications
You must be signed in to change notification settings - Fork 650
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Generator detects debug messages from NetSNMP as parsing errors #508
Comments
Why is netsnmp printing those? I've never seen them when I'm running it. |
I was reading a bit the code of NET-SNMP. It seems that the warning about Regarding the
I created the file using the command |
I don't know offhand, however I'd expect this to Just Work on the part of net-snmp as we're not doing anything unusual. |
I think I found the issue. NET-SNMP reads the configuration files via the function It seems the recommended way to initialize the application is via Then, NET-SNMP reads configuration files from several places but one of them is via reading the environment variable I tried and now I get all the verbosity output I was expecting with my configuration file. If you agree with that change, I can make a PR. My warnings
|
That seems reasonable, how would we override things though to ensure that only parse errors show up? |
Apart from the log message saying that it will create a directory, the rest of the messages are valid warnings or errors. I enabled the logging and tried with the MIB files downloaded via
To fix the warnings related to RFC1155-SMI and RFC1213 it's just to download the MIB defined in the RFC (unfortunately there are no official download as the official thing is the spec itself with the MIB definition). Not sure about how to fix the warnings related to pico. To fix the first warnings about the macro it would be necessary to find the MIB redefining these macros that already defined in the MIB compilers and remove them. I think those warnings need to be fixed before enabling this logging. |
Generally warnings can be fixed by having exactly the right set of MIBs. Are any of those useful in terms of pointing out problems, or are they noise? |
In this case, looks more than warnings that are nice to fix but not mandatory. But with the set of MIB our software uses, these new warnings help me to realize we were missing MIBs like IANAifType that was causing some metrics to just not appear without any other warning. |
If we're to enable a higher level of warnings, then we should first ensure that the example config produces no such warnings. |
How did you manage to enable this extra verbosity in the generator? I always run snmp-generator in Docker so I tried adding the SNMPCONFPATH variable and the file as shown in this thread but it didn't work. My command is like this: docker run --rm -it --name snmp-generator \
-v "${PWD}:/opt/" \
-v "${PWD}/../mibs:/mibs:ro" \
-e MIBDIRS=/mibs \
-e SNMPCONFPATH=/opt/snmp.conf \
prom/snmp-generator:main generate I'm trying to diagnose the cause of this error:
|
Host operating system
Statically compiled from Docker image
golang:1.14.2-alpine3.11
and run in Docker imageprom/snmp-exporter:v0.17.0
. Compiled as follow:snmp_exporter version
v0.17.0
What device/snmpwalk OID are you using?
N/A
If this is a new device, please link to the MIB(s).
N/A
What did you do that produced an error?
Run the generator as follow:
What did you expect to see?
No error parsing error message, the operation should have succeed.
What did you see instead?
The process returned with error code 1 and showing this warning:
After adding in
main.go
at line 120 the following line:fmt.Println(parseOutput)
I saw the reason of the failure:NetSNMP is printing these four debug messages and the generator thinks they are parsing errors since it just counts the number of output lines from NetSNMP.
I also suggest that the generator prints always as debug level of verbosity the output of NetSNMP so it's easier to debug without code changes.
The text was updated successfully, but these errors were encountered: