Comments (4)
Yes, I think this may need to be fixed upstream first.
from snmp_exporter.
I've done some more learning and think this may be more of a bug with Switch B. BITS
"types" (not the ANS.1 Bitstring
type, but rather an SNMP "construct", https://datatracker.ietf.org/doc/html/rfc1906#section-8 ) are meant to be encoded and reported as the ASN.1 Octet String
type. Switch B seems to report the encoding type as 0x03, Bitstring
, but then proceed to encode it as an Octet String
. Somehow snmpget
figures this out though, somewhere in here probably https://github.com/net-snmp/net-snmp/blob/master/snmplib/mib.c#L1809 . It is probably desirable for gosnmp to behave similarly, handling Bitstring
as Octet String
.
from snmp_exporter.
I'm not great with C, but it looks like this is where ASN Bitstring is parsed: https://github.com/net-snmp/net-snmp/blob/90a70ebd82ae1b545e7a58c1b3eb10981cb85adc/snmplib/asn1.c#L1824 . Doing some tracing on Switch B's output through this makes it seem like that Bitstring parsing code isn't that careful and essentially treats Bitstrings as Octet Strings.
Tracing that function also explains why Switch B reports Bitstring: 03
in the debug output when the actual BITS data is 3E
. It is (unintentionally) just reporting 0x03, the Bitstring type code.
from snmp_exporter.
It seems the ASN.1 Bitstring type has no place, officially, in SNMP. Encoding a BITS construct as anything other than an Octet String is incorrect. It just happens to be that netsnmp (kind of) handles it. I'll close this and the other issue as I'm reasonably confident this is simply incorrect behavior from the switch.
from snmp_exporter.
Related Issues (20)
- Cut a release HOT 6
- data never changes on exporter HOT 2
- Module mikrotik:error in unmarshalResponse: expected a sequence when unmarshalling a VB, got 2
- use_unconnected_udp_socket problem?
- Can't manually pull tags from OID
- Lookups returning empty strings when use the index lookup cdpCacheDeviceId
- get snmpv2 data using by tcp failed
- Error generating a MIB
- snmpwalk get large amount of information but snmp_exporter does not
- Connecting snmp-exporter prometheus to cisco switches
- Juniper MX204 Router SNMP walk fails for jnxBfdSessIntfName
- Problem generating SNMP config for cIpM... metrics HOT 5
- make mibs fails on readydataos
- [Doc] SNMP example minor nit HOT 1
- InetAddressType Indexes/Indices being omitted HOT 5
- [ASK] Add module for HP Switch v1910
- Errors while generating config for cisco switch
- Parse date and time from DisplayString HOT 3
- Snmpbulk works, but snmp_exporter does not
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from snmp_exporter.