-
Notifications
You must be signed in to change notification settings - Fork 633
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
multiline string in SNMPv2-MIB:sysDescr produces garbled output #440
Comments
I see the same behaviour with a manually built snmp_exporter from a few days ago( HEAD/40d8840915d961a8e3d3ae88a65f5d35072a9d8b), built with go 1.2.6 |
Something very odd is going on here, invalid output like this should be impossible. Can you get the hex version of both the sysDescr and what's on the /metrics? |
(small omissions of internal data, as bulkwalk returned more objects than necessary)
curl | hexdump -C
|
hmm, is that some weird \LF vs \CRLF and the shell etc overwriting itself is going on? |
the device sends the 0x0d character before every newline, which is "\CR" or "Carriage Return" but no linefeed... |
|
I think you can close this, this smells of "user too stupid" error. I don't think theres anything wrong with the exporter. |
hmm, as you do escape \n, do you also need to escape \r in the exporter? |
TLDR: Old Cisco device sends DOS-Style newlines with \r\n. snmp_exporter escapes the \n newline, but does not escape the \r carriage return, causing the output to overwrite itself. |
False alarm then. |
Hmmm. The device sends
|
That's the correct encoding for a /metrics. |
A multiline sysDescr string on an ancient Cisco 2800 produces garbled output and no valid key{tags} value line, breaking the Prometheus HTTP Metrics output format.
Host operating system: output of
uname -a
Linux (hostname) 4.9.0-8-amd64 #1 SMP Debian 4.9.144-3.1 (2019-02-19) x86_64 GNU/Linux
(added info: this is running within an LXC container)
snmp_exporter version: output of
snmp_exporter -version
snmp_exporter, version 0.15.0 (branch: HEAD, revision: 92a3da4)
build user: root@8c3a7c03d455
build date: 20190212-13:40:02
go version: go1.11.5 (same error also with go 1.2.6)
What device/snmpwalk OID are you using?
1.3.6.1.2.1.1.1 (sysDescr)
relevant excerpt from snmp.yml:
If this is a new device, please link to the MIB(s).
It's an ancient Cisco2800, but the query goes to SNMPv2-MIB::sysDescr
What did you do that produced an error?
Query a sysDescr that is multiline
What did you expect to see?
What did you see instead?
The text was updated successfully, but these errors were encountered: