improve(go.d/snmp-profiles): extend transformEntitySensorValue#20594
Merged
ilyam8 merged 3 commits intonetdata:masterfrom Jun 29, 2025
Merged
improve(go.d/snmp-profiles): extend transformEntitySensorValue#20594ilyam8 merged 3 commits intonetdata:masterfrom
ilyam8 merged 3 commits intonetdata:masterfrom
Conversation
…port to CISCO-ENTITY-SENSOR-MIB
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR extends SNMP sensor value transformation to support Cisco’s ENTITY-SENSOR-MIB and updates both Catalyst and ASA profiles to invoke the new transformer and supply required tags.
- Renames and enhances the normalization function to handle both standard and Cisco-specific sensor tables.
- Updates Catalyst and ASA SNMP profiles with the new transform call and adds necessary metric tags.
- Adds new sensor-type mappings (
special_enumandpower_dbm) to the transformer.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/go/plugin/go.d/config/go.d/snmp.profiles/default/_cisco-catalyst.yaml | Added transformEntitySensorValue call and new metric_tags |
| src/go/plugin/go.d/config/go.d/snmp.profiles/default/_cisco-asa.yaml | Switched to transformEntitySensorValue, added index/descr |
| src/go/plugin/go.d/collector/snmp/ddsnmp/transform.go | Renamed transform function, updated docs, extended mappings |
Comments suppressed due to low confidence (4)
src/go/plugin/go.d/config/go.d/snmp.profiles/default/_cisco-catalyst.yaml:55
- The
sensor_precisiontag is pointing toentSensorScaleinstead ofentSensorPrecision. It should reference the entSensorPrecision symbol (OID .1.3.6.1.4.1.9.9.91.1.1.1.1.3) to apply the correct precision.
name: entSensorScale
src/go/plugin/go.d/config/go.d/snmp.profiles/default/_cisco-asa.yaml:135
- After switching to
transformEntitySensorValue, the ASA profile also needssensor_scaleandsensor_precisionmetric tags so the transformer can perform scaling. Without these tags, the transformation will fail to retrieve scale and precision.
{{- transformEntitySensorValue .Metric -}}
src/go/plugin/go.d/collector/snmp/ddsnmp/transform.go:192
- [nitpick] The
special_enumtype has no value-to-string mapping defined. Consider adding a mapping table or documenting the expected integer values so consumers know how to interpret this vendor-specific enum.
"13": {"name": "special_enum", "family": "Status", "desc": "Vendor-specific enumerated sensor"},
src/go/plugin/go.d/collector/snmp/ddsnmp/transform.go:143
- The extended behavior of
transformEntitySensorValue(including Cisco-specific MIB support) isn’t covered by existing tests. Please add unit tests for both standard ENTITY-SENSOR-MIB and CISCO-ENTITY-SENSOR-MIB cases.
"transformEntitySensorValue": func(m *Metric) string {
…port to CISCO-ENTITY-SENSOR-MIB
sashwathn
approved these changes
Jun 29, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
to support to CISCO-ENTITY-SENSOR-MIB
Summary
Test Plan
Additional Information
For users: How does this change affect me?