-
Notifications
You must be signed in to change notification settings - Fork 637
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
Allow overriding of MIB information #186
Comments
Here's a use-case: the Dell MIB (in my case for the M1000e blade chassis) encodes various floating-point numbers as OctetStrings. I can't extract these currently with the regex_extracts functionality because OctetStrings get encoded as 0x333530362E303030 prior to the regex getting the value. If I override (manually edit snmp.yml) the type as DisplayString then the regex will work. Perhaps I'll be required to specify encoding since OctetStrings are opaque bytes... in this case I'd guess ascii or utf8. Here's what snmpwalk outputs:
And the corresponding generated yaml: - name: drsWattsReading
oid: 1.3.6.1.4.1.674.10892.2.4.1.1.13
type: OctetString
help: 0004.0001.0001.0013 This attribute defines the instantaneous chassis power
usage (in Watts). - 1.3.6.1.4.1.674.10892.2.4.1.1.13
indexes:
- labelname: drsChassisIndex
type: gauge |
Another example is - name: prtMarkerSuppliesDescription
oid: 1.3.6.1.2.1.43.11.1.1.6
type: OctetString
help: The description of this supply container/receptacle in the localization
specified by prtGeneralCurrentLocalization. - 1.3.6.1.2.1.43.11.1.1.6
indexes:
- labelname: hrDeviceIndex
type: gauge
- labelname: prtMarkerSuppliesIndex
type: gauge |
I suspected those existed, these will be covered. |
Actually we won't support prtMarkerSuppliesDescription or anything else with localized strings where we have to look up another object to find the encoding. |
I think it would already help if it was possible to specify the encoding for metric entries in Generator support can be added later/independently if required. |
Such encodings would have to be a separate issue, this covers simpler type handling. In general we don't handle things that require parsing English, such as this. |
Do you see these overrides in between generator and config, between config and scrapes, or after scrapes? |
This is a generator thing. |
Another instance where re-casting DisplayString into float would be useful. Storing this information in a label does not scale as a lot of those values are different after a minute and our retention is ten years. http://www.circitor.fr/Mibs/Mib/F/FORTINET-FORTIGATE-MIB.mib
Sample data:
We opened an issue upstream, but do not expect much willingness to introduce new OIDs. |
We already support extracting floats from strings. |
We now have 3 types of overrides, Ignore, Regexp Extracts, and Type. Are there any more we need |
I am wondering if there's any use in Regexp Ignore & Type, but else I can't think of anything. Why not cut a release for this? |
I'm not sure what you mean by "Regexp Ignore & Type". We just merged the Ignore and Type overrides recently, we can cut a new release sometime soon. |
"If that regex matches, do that other override" |
Generator changes do not require a release. |
I'm trying the "type" override now. Looks good for my use-case. Here's the OID metric from my previous example as normally encoded:
When I add an override for type: DisplayString I get
Then if I regex_extracts the value like so:
I get this metric:
Which is pretty much what I want. I tried going directly to "type: Float" but I always get a value of 0. Maybe that isn't intended for my float-as-OctetString case?
|
That's more a usage question, which is best handled on the mailing lists. |
Trying to override mtxrFirmwareVersion from Mikrotik.mib, using docker SNMP Exporter Config Generator. After some digging I found the same problem with resolution. But my generator fails with the following error
Here is my generator.yml file:
|
I think we're largely done here. If there's additional stuff needed, we can file issues as needed. |
Some MIBs aren't quite right, particularly around types. Figure out what's a sane config syntax to allow for per-module overrides of bits of MIBs.
Augments also need overriding, but we might hardcode those.
The text was updated successfully, but these errors were encountered: