-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
SNMP Table Indices not added as Tags #1948
Comments
cc @phemmer |
This is happening because the MIB has that OID listed as |
Ah, I see, somehow I was led to believe that snmptables just ignored the index column in my environment.
Someone seeming to have authority said following:
That means that the approach the code (or my workaround - which shouldn't work, because the attribute is still 'not-accessible') takes is indeed "illegal" from a standardization point of view. So instead of relying on a Index Attribute the index should probably extracted from the OID? |
We do extract the index from the OID. It's just used internally within the plugin for identifying all the columns in each row. If you're proposing we should automatically add this index to the output tags, I would be opposed to that. |
With 'snmptable' I can add the '-Ci' switch to show the index. In Telegraf I can't access this information, even if I wanted to. The workaround indeed only works if the snmp agent doesn't adhere to the definitions in the MIB and actually allows access to an attribute that has "MAX-ACCESS not-accessible"... With an other SNMP Agent I do not get any data when querying the index value - and telegraf aborts the query. So while I can understand your point, I don't have a column to identify a row in every table I'd ever want to query. Think of a switch listing all the fancy error and packet counters for every port it has but no Identifier as to which port this data belongs to... Maybe all Switch MIBs are designed carefully enough to never be in that situation, but there are other SNMP agents out there... So I'd like to add something like "-Ci" to the query to have the Index added to the table. |
Err. No. IF-MIB just ignores the SMI-v2-Rule stated above and defines "ifIndex" as Read-Only. |
I'll look into a You said you had one agent which doesn't respond to queries for the not-accessible OID. What do you get when you try to use |
Thanks, that'd be great.
|
@phemmer: I might be running into the same issue here.
As you can see, the mac address is used as an index here, and also given in the My config looks like this:
Is this the same issue, or something else? |
@flokli can you provide the output of However at a glance, this does not seem like the same issue. |
@phemmer Sure, the output looks like this:
The MIB can be found here. If it helps, I can also provide the output on a device with 2 simultaniously connected stations, just in case :-) |
Yeah, using that data I am unable to reproduce. Are you using the current telegraf version?
|
Argh, I had a |
@phemmer - I tried PR #2366 with a more common In both cases the primary index identifies the IP version as defined in the module compliance section:
The effort (if even possible) may not be justified, but would it be possible to use these names for the index value? IE: instead of using a tag Using an
|
While this PR does allow the metrics to be collected using an auto-table, it does present a quirk for multi-index items. The above-noted For instance, instead of using
|
Bug report
When using the "auto table" conf syntax, table indices are not added as tags, even though the source code implies they should.
Relevant telegraf.conf:
System info:
Telegraf - version 1.0.1
Ubuntu 14.04.5 LTS
NET-SNMP version: 5.7.2
This probably occurs on any MIB table structure, but here's the MIB-File for this example: Raritan PDU-MIB
Steps to reproduce:
Expected behavior:
The output should show tags for the table.
Actual behavior:
The output doesn't show any tags for the table.
Additional info:
Problem probably results from using "SNMPtranslate" to parse MIB. Commands extracted from source code are: snmp.go#L221
The INDEX field probably gets parsed fine to tagOIDs, but then snmptable is used to fetch the table header:
As you can see, the index attribute is not listed. This results in
a) lineVoltageIndex not being queried
b) lineVoltageIndex not being marked as tag.
My current workaround is to add a seperate "table.field" for the index like this:
The text was updated successfully, but these errors were encountered: