-
Notifications
You must be signed in to change notification settings - Fork 624
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
servertech_sentry3 scraping broke between 0.20.0 and 0.21.0 #1080
Comments
Git bisect shows the error was introduced with 4449004.
|
Revert to gosnmp@v1.32.0, with commenting out the LocalAddr feature, does make the excporter work again. |
It seems like this error message was introduced in gosnmp/gosnmp#373 to fix invalid SNMP packet data. |
Interestingly, I also have a servertech sentry3 device. I tested with v0.25.0 and don't run into this. I wonder if your device firmware has a bug. What version of the firmware are you running? |
|
That version is from 2008. There have been major updates to the Sentry firmware since then. I'm guessing this is a firmware bug in the old SNMP library. https://cdn10.servertech.com/assets/documents/documents/909/original/swcdu-history.txt |
snmpbulkwalk does handle this case correctly, so I'm wondering if it's worthwhile to provide parity. I'll chase the people with admin to the device to update it anyway. |
Adding a workaround for this would probably require upstream changes in gosnmp. Opening an issue there, with some tcpdump packet captures of net-snmp Especially helpful would be to reduce the walk to the specific OIDs that are returning the weird data. |
I patched go-snmp to print the OID when it fails to decode. This bug is only happening when snmp_exporter is walking the OID tree. Here's the byte dump from before, split up:
In the debug output from snmp_exporter, we see an ASN.1 encoded integer supposedly as "02 00" But the net-snmp output for it shows boring and correct ASN.1 (02 01 00) net-snmp source should also error on a integer w/ asnlength==0
gosnmp example2 (minor patches to pass OID & community) also WORKS:
next up, trying to a tcpdump of snmp_exporter and comparing to the tcpdump of gosnmp examples. |
Did the tcpdumps, found a reproduction case. snmp_exporter-0.20.0 just silently returned a value of 0 for these fields instead of throwing an error.
|
Deeper debugging shows there's a subtle firmware bug in requesting the last OID values available, depending on the max repetitions. PR forthcoming to change max repetitions for this device, via Generator The device I have access to, exposes 349 OID values, when I do snmpbulkwalk.
|
I'm going to use max-repetitions=4 in the fix, because that's the highest value for which no OID probed will ever trigger the bug. |
servertech_sentry3 devices can return bad ASN.1 data, an Integer with asnlength=0 under certain cases. - Certain firmware versions only - SNMP BULKGET - Specific OIDs deep into the tree, at different repetition values Work around the problem by setting max_repetitions=4, which doesn't trigger the device bug. Closes: prometheus#1080 Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Thanks for all the investigation work. |
servertech_sentry3 devices can return bad ASN.1 data, an Integer with asnlength=0 under certain cases. - Certain firmware versions only - SNMP BULKGET - Specific OIDs deep into the tree, at different repetition values Work around the problem by setting max_repetitions=4, which doesn't trigger the device bug. Closes: #1080 Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
) servertech_sentry3 devices can return bad ASN.1 data, an Integer with asnlength=0 under certain cases. - Certain firmware versions only - SNMP BULKGET - Specific OIDs deep into the tree, at different repetition values Work around the problem by setting max_repetitions=4, which doesn't trigger the device bug. Closes: prometheus#1080 Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> Signed-off-by: Harshavardhan Musanalli <Harshavardhan.Musanalli@amadeus.com>
Between 0.20.0 and 0.21.0, the servertech_sentry3 module stopped working, as is still broken as of v0.25.0.
Host operating system: output of
uname -a
Linux (redacted) 6.1.38-gentoo-dist #1 SMP PREEMPT_DYNAMIC Thu Jul 6 11:45:23 -00 2023 x86_64 QEMU Virtual CPU version 2.5+ GenuineIntel GNU/Linux
snmp_exporter version: output of
snmp_exporter -version
What device/snmpwalk OID are you using?
servertech_sentry3
What did you do that produced an error?
curl 'localhost:9116/snmp?target=10.0.1.18&auth=(redacted)&module=servertech_sentry3'
What did you expect to see?
Metrics
What did you see instead?
logging output with errors, as seen on 0.21.0, 0.24.1:
logging output as seen on 0.20.0:
curl output as on 0.20.0:
The text was updated successfully, but these errors were encountered: