Homeโ€บ๐Ÿ“ก SNMP Extensionsโ€บModule 42 min read ยท 5/16

Advanced SNMP

Hands-on2 exercises

Filtering Empty Values

SNMP devices often return n/a or empty strings for unused interfaces. Filter them out to prevent ghost entities:

dimensions:
  - key: if.name
    value: oid:1.3.6.1.2.1.31.1.1.1.1
    filter: const:$not($eq(n/a))

๐Ÿ’ก Without this filter, Dynatrace creates entity pages for empty interfaces nobody cares about.

32-bit vs 64-bit Counters

32-bit counters wrap at ~4GB. On a 10Gbps link, that's every 3.4 seconds โ€” making the data useless. Always use 64-bit:

Metric32-bit (avoid)64-bit (use)
Bytes In1.3.6.1.2.1.2.2.1.10 ifInOctets1.3.6.1.2.1.31.1.1.1.6 ifHCInOctets
Bytes Out1.3.6.1.2.1.2.2.1.16 ifOutOctets1.3.6.1.2.1.31.1.1.1.10 ifHCOutOctets
Unicast In1.3.6.1.2.1.2.2.1.11 ifInUcastPkts1.3.6.1.2.1.31.1.1.1.7 ifHCInUcastPkts
Unicast Out1.3.6.1.2.1.2.2.1.17 ifOutUcastPkts1.3.6.1.2.1.31.1.1.1.11 ifHCOutUcastPkts

โš ๏ธ The 32-bit OIDs are from IF-MIB (ifTable). The 64-bit OIDs are from IF-MIB (ifXTable). Both share the same ifIndex โ€” safe to mix in one subgroup.

๐Ÿ›  Try it

Replace the 32-bit counter OIDs with their 64-bit equivalents. ifInOctets โ†’ ifHCInOctets (1.3.6.1.2.1.31.1.1.1.6), ifOutOctets โ†’ ifHCOutOctets (1.3.6.1.2.1.31.1.1.1.10).

extension.yamlYAML
Loading...

Cross-Table Mixing (DED018)

Each SNMP table has its own index space. You cannot mix OIDs from different tables in the same subgroup:

TableIndexExample OIDs
ifTable / ifXTableifIndexifDescr, ifHCInOctets, ifHighSpeed
ipAddrTableipAdEntAddripAdEntIfIndex, ipAdEntNetMask
entPhysicalTableentPhysicalIndexentPhysicalDescr, entPhysicalClass

โš ๏ธ Mixing ifTable OIDs with ipAddrTable OIDs in one subgroup = wrong data matched to wrong rows. This was the exact bug in ACI v0.0.3.

Compatible exceptions (shared index): ifTable + ifXTable, entPhysicalTable + entSensorValueTable.

OID Validation Rules (from Dynatrace source)

These are the exact validation checks Dynatrace runs on your OIDs:

Check                    DED Code  Rule
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
OID syntax               DED015    Must match /^\d[.\d]+\d$/ โ€” no leading/trailing dots
OID in bundled MIBs      DED010    OID must exist in a MIB file in snmp/ directory
Scalar vs table          DED016    table:true โ†’ OID must NOT end in .0
                                   table:false โ†’ OID MUST end in .0
Cross-table OIDs         DED018    All OIDs in a subgroup must share same table index
Metric key naming        DED006    Count metrics must have .count suffix
Metric key naming        DED007    Gauge metrics must NOT have .count suffix
Duplicate metric keys    DED001    Each metric key must be unique
Missing dimensions       DED003    Table metrics need at least one dimension

๐Ÿ’ก Run python3 validate_extension.py ext/ to check all these rules before building. DED018 (cross-table) is the #1 bug found across 13 real extension validations.

Extensions API v2 โ€” Lifecycle

The full extension lifecycle via API (18 endpoints):

1. Upload:    POST /api/v2/extensions          (multipart, zip file)
2. List:      GET  /api/v2/extensions           (all extensions)
3. Get:       GET  /api/v2/extensions/{name}    (versions list)
4. Activate:  POST /api/v2/extensions/{name}/{version}/environmentConfiguration
5. Configure: POST /api/v2/extensions/{name}/monitoringConfigurations
6. Status:    GET  /api/v2/extensions/{name}/{version}/environmentConfiguration
7. Delete:    DELETE /api/v2/extensions/{name}/{version}
๐Ÿ›  Try itExercise 2

This subgroup mixes ifTable and ipAddrTable OIDs โ€” a DED018 cross-table bug. Move the IP address OID (1.3.6.1.2.1.4.20.1.1) into its own subgroup called IP Addresses.

extension.yamlYAML
Loading...

What's Next

Module 5 โ€” Topology. Turn your metrics into entities that appear in the Dynatrace UI with relationships.