name: project-snmp-profiles-authoring description: Use when editing Netdata SNMP profile YAMLs, topology SNMP profiles, ddsnmp profile parsing, or profile-format documentation. Requires checking source MIB field accessibility, especially MAX-ACCESS not-accessible INDEX objects, before adding or changing profile symbols.
SNMP Profile Authoring
Use this skill before editing files under:
src/go/plugin/go.d/config/go.d/snmp.profiles/src/go/plugin/go.d/collector/snmp/ddsnmp/src/go/plugin/go.d/collector/snmp/profile-format.mdsrc/go/plugin/go.d/collector/snmp_topology/
Required Checks
- Identify the source MIB object for every profile field being added or changed.
- Check the object's
MAX-ACCESS. - If the object is
not-accessible, do not configure it as a readablesymbol.OID. - If a
not-accessibleobject appears in the tableINDEX, derive it from the row OID index usingindexorindex_transform. - Keep index extraction and value formatting separate:
- use
indexfor one index component; - use
index_transformfor multiple components; - use
symbol.formatonly for final formatting such asip_address,mac_address, orhex.
- use
- Put SNMP topology rows under top-level
topology:with a required closedkind. Do not mark topology rows by naming metrics_topology_*. - Do not use chart/export-only value fields on topology row anchor symbols:
chart_meta,metric_type,mapping,transform,scale_factor,format, orconstant_value_one. - Keep regular
systemUptimerows undermetrics:. Do not model uptime as a topology row kind; topology-specific uptime acquisition belongs in collector code, not profile topology schema. - Put SNMP licensing rows under top-level
licensing:. Do not model licensing telemetry as underscore-prefixed hidden metrics or_license_*tag protocols. - Licensing row value symbols may use
formatand exactmapping, but must not use chart/export fields, transforms, scale factors, constant values, or underscore-prefixed generated names. - For scalar licensing rows that combine multiple scalar signal OIDs into one
license row, declare an explicit stable
id:. For table licensing rows, keepfrom:references inside the same table OID and derivenot-accessibleINDEX values from the row index. - Put SNMP BGP rows under top-level
bgp:. Do not model BGP telemetry as vendor-specific raw metrics,virtual_metrics, or underscore-prefixed tag protocols when adding or migrating BGP coverage. - BGP peer-state mappings must use the six RFC 4271 canonical states
(
idle,connect,active,opensent,openconfirm,established). Usepartial: truepluspartial_statesonly when the source MIB is intentionally partial. - For BGP table rows, derive
not-accessibleINDEX objects with exactly one row-index selector:index,index_from_end, orindex_transform. Useindex_from_endfor trailing AFI/SAFI-like components after variable-length indexes such asInetAddress.
Index Rules
indexis 1-based.index_transform.startandindex_transform.endare 0-based and inclusive.index_transform: [{start: N}]keeps index componentNthrough the last component whenN > 0.index_transform: [{start: 0, end: 0}]keeps only the first index component.drop_rightcan be used when the right side has fixed trailing components.
Common Patterns
Q-BRIDGE learned FDB MAC:
- tag: dot1q_fdb_mac
symbol:
format: mac_address
index_transform:
- start: 1
IP-MIB ipNetToPhysicalTable address:
- tag: arp_ip
symbol:
format: ip_address
index_transform:
- start: 3
The start: 3 skips ifIndex, address type, and the InetAddress length byte.
LLDP-MIB local management address:
- tag: lldp_loc_mgmt_addr
symbol:
name: lldpLocManAddr
format: hex
index_transform:
- start: 2
The start: 2 skips management-address subtype and length. Use hex, not
ip_address, because LLDP management addresses can carry non-IP subtypes; the
topology runtime normalizes IP-compatible bytes later.
Audit Recipe
When a profile reads a table column, verify that the MIB object is readable:
rg -n -C 4 'OBJECT-TYPE|MAX-ACCESS[[:space:]]+not-accessible|ACCESS[[:space:]]+not-accessible' path/to/MIB
For known topology-sensitive symbols, scan profile YAMLs before committing:
rg -n 'name:[[:space:]]*(dot1qTpFdbAddress|ipNetToPhysicalIfIndex|ipNetToPhysicalNetAddressType|ipNetToPhysicalNetAddress|lldpLocManAddrSubtype|lldpLocManAddr)\b' src/go/plugin/go.d/config/go.d/snmp.profiles
Any hit must be reviewed. It is valid only when the tag is index-derived and does not declare symbol.OID for a not-accessible object.
When adding a new topology kind, update all three parts together:
- profile YAML using
topology: - kind: <kind>; - the Go
TopologyKindenum and validation; - the topology cache handler registry and tests.
Verify that topology rows are delivered through ProfileMetrics.TopologyMetrics,
not through underscore-prefixed HiddenMetrics.
When adding or migrating licensing profile coverage, update all related parts together:
- profile YAML using
licensing:; - the closed licensing signal/state/sentinel enums and validation when adding new policy names;
- typed
ProfileMetrics.LicenseRowsproducer/consumer tests; - MIB evidence for every OID and every
not-accessibleindex-derived field.
Verify that licensing rows are delivered through ProfileMetrics.LicenseRows,
not through underscore-prefixed HiddenMetrics.
When adding or migrating BGP profile coverage, update all related parts together:
- profile YAML using
bgp:; - closed BGP row kind, peer-state, AFI/SAFI, and typed field validation when adding new policy names or value domains;
- typed
ProfileMetrics.BGPRowsproducer/consumer tests; - MIB evidence for every OID and every
not-accessibleindex-derived field; - SNMP integration metadata and generated docs when public BGP capability claims change.
Verify that BGP rows are delivered through ProfileMetrics.BGPRows, not
through metrics:, virtual_metrics:, or underscore-prefixed hidden metrics.
When adding or refactoring SNMP profile, parser, or topology tests, prefer
table-driven cases using map[string]struct{} keyed by test-case name when
the cases share setup and assertion shape. Use separate test functions only for
materially different setup or assertions.
Validation
Run the narrow suites for the changed area:
cd src/go
go test ./plugin/go.d/collector/snmp/ddsnmp/ddprofiledefinition
go test ./plugin/go.d/collector/snmp/ddsnmp/ddsnmpcollector
go test ./plugin/go.d/collector/snmp_topology
See src/go/plugin/go.d/collector/snmp/profile-format.md for the full profile syntax and the "Field accessibility" section.