Skip to content

improve(go.d/snmp-profiles): extend transformEntitySensorValue#20594

Merged
ilyam8 merged 3 commits intonetdata:masterfrom
ilyam8:go.d-ddsnmp-prof-transform
Jun 29, 2025
Merged

improve(go.d/snmp-profiles): extend transformEntitySensorValue#20594
ilyam8 merged 3 commits intonetdata:masterfrom
ilyam8:go.d-ddsnmp-prof-transform

Conversation

@ilyam8
Copy link
Member

@ilyam8 ilyam8 commented Jun 29, 2025

to support to CISCO-ENTITY-SENSOR-MIB

Summary
Test Plan
Additional Information
For users: How does this change affect me?

@ilyam8 ilyam8 requested a review from Copilot June 29, 2025 07:23
@github-actions github-actions bot added area/collectors Everything related to data collection collectors/go.d area/go labels Jun 29, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_enum and power_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_precision tag is pointing to entSensorScale instead of entSensorPrecision. 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 needs sensor_scale and sensor_precision metric 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_enum type 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 {

@ilyam8 ilyam8 enabled auto-merge (squash) June 29, 2025 08:23
@ilyam8 ilyam8 merged commit dcf507f into netdata:master Jun 29, 2025
107 checks passed
@ilyam8 ilyam8 deleted the go.d-ddsnmp-prof-transform branch June 29, 2025 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/collectors Everything related to data collection area/go collectors/go.d

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants