Skip to content
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

Merged
merged 5 commits into from
May 19, 2017
Merged

Update generator #162

merged 5 commits into from
May 19, 2017

Conversation

SuperQ
Copy link
Member

@SuperQ SuperQ commented May 17, 2017

Use lookup node's index label in the generator:

  • 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.

Use an explicit OID for ifName lookups.

  • This avoids the ifName conflict caused by the Citrix netscaler NS-ROOT-MIB module.

Update snmp.yml

  • This updates with the latest generator code, removes non-accessible
    metrics from being used.

Misc:

  • Ignore the generator binary from the git repo.

SuperQ added 2 commits May 17, 2017 17:11
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.
@@ -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
Copy link
Contributor

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
Copy link
Contributor

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

Copy link
Member Author

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.

SuperQ added 2 commits May 17, 2017 17:40
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.
@SuperQ SuperQ force-pushed the ifName-conflict branch from 9c27702 to 1d16804 Compare May 17, 2017 15:40
@brian-brazil brian-brazil merged commit d6f35c9 into prometheus:master May 19, 2017
SuperQ added a commit to SuperQ/snmp_exporter that referenced this pull request Jun 6, 2017
* [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
@SuperQ SuperQ mentioned this pull request Jun 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants