-
Notifications
You must be signed in to change notification settings - Fork 642
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
Update generator #162
Update generator #162
Conversation
Instead of using the literal name from the generator's config, use the Label from the MIB index. This allows OIDs to be used in the `new_index` field in the generator.yml.
generator/generator.yml
Outdated
@@ -10,7 +10,7 @@ modules: | |||
walk: [sysUpTime, interfaces, ifXTable] | |||
lookups: | |||
- old_index: ifIndex | |||
new_index: ifName | |||
new_index: 1.3.6.1.2.1.31.1.1.1.1 # ifName |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should have a comment as to why we're doing this
@@ -195,14 +195,14 @@ func generateConfigModule(cfg *ModuleConfig, node *Node, nameToNode map[string]* | |||
} | |||
indexNode := nameToNode[lookup.NewIndex] | |||
// Avoid leaving the old labelname around. | |||
index.Labelname = lookup.NewIndex | |||
index.Labelname = indexNode.Label |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change should have a unittest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a test for OID-based lookups.
This avoids the ifName conflict caused by the Citrix netscaler NS-ROOT-MIB module.
This updates with the latest generator code, removes non-accessible metrics from being used.
* [FEATURE] Add Homepage on /. prometheus#135 * [IMPROVEMENT] Add ddwrt OIDs to generator. prometheus#147 * [IMPROVEMENT] Add synology OIDs to generator. prometheus#149, prometheus#154 * [IMPROVEMENT] Use lookup node's index label in the generator. prometheus#162 * [BUGFIX] Fix `authNoPriv` in config parsing. prometheus#141 * [BUGFIX] Update gosnmp vendoring to fix timeouts/errors. prometheus#139, prometheus#171
Use lookup node's index label in the generator:
Label from the MIB index. This allows OIDs to be used in the
new_index
field in the generator.yml.Use an explicit OID for ifName lookups.
Update snmp.yml
metrics from being used.
Misc: