šŸ“” SNMP Extensions — Module 4

Advanced SNMP

Hands-on

MIB Bundling

Standard MIBs (IF-MIB, SNMPv2-MIB, ENTITY-MIB) ship with ActiveGate. Vendor-specific MIBs must be bundled in your extension's snmp/ directory.

extension.zip/
ā”œā”€ā”€ extension.yaml
└── snmp/
    ā”œā”€ā”€ CISCO-PROCESS-MIB.my
    ā”œā”€ā”€ CISCO-ENTITY-FRU-CONTROL-MIB.my
    └── CISCO-ENTITY-SENSOR-MIB.my

Where to get MIBs:

  • Cisco: github.com/cisco/cisco-mibs/tree/main/v2
  • Other vendors: Search "{vendor} MIB download" — most publish them publicly
  • Your device: Many devices let you download MIBs from the management UI

Without the MIB, your extension still works — but OID names won't resolve, enumerated values show as numbers instead of strings, and IP addresses may show as hex instead of dotted notation.

$networkFormat — Address Translation

Some OIDs return binary data that needs translation (IP addresses, MAC addresses). Use $networkFormat:

dimensions:
  # Two OIDs: formatter tells how to interpret the data OID
  - key: ip.address
    value: $networkFormat(oid:1.3.6.1.2.1.4.34.1.1, oid:1.3.6.1.2.1.4.34.1.3)

  # One OID with explicit type
  - key: mac.address
    value: $networkFormat(const:macAddress, oid:1.3.6.1.2.1.2.2.1.6)

  # With fallback default
  - key: ip.address
    value: $networkFormat(oid:1.3.6.1.2.1.4.34.1.1, oid:1.3.6.1.2.1.4.34.1.3, default:unknown)

Supported types: interfaceAlias, interfaceName, portComponent, networkAddress (ipv4/ipv6/mac/dns), macAddress, agentCircuitId.

Variables — User-Configurable Extensions

Variables let users customize your extension from the monitoring configuration UI without editing YAML.

vars:
  - id: ifNameFilter
    displayName: Interface name filter
    type: text
    description: "Only monitor interfaces matching this pattern"

  - id: pollInterval
    displayName: Polling interval
    type: enum
    defaultValue: "1"
    availableValues:
      - value: "1"
        displayName: Every minute
      - value: "5"
        displayName: Every 5 minutes

Use variables in dimensions as filters:

dimensions:
  - key: if.name
    value: oid:1.3.6.1.2.1.31.1.1.1.1
    filter: var:ifNameFilter    # User controls which interfaces to monitor

Or as dimension values:

dimensions:
  - key: custom.tag
    value: var:ext.activationtag

Debugging SNMP Polling

When things go wrong, ActiveGate logs tell you exactly what happened.

Log Locations (Linux)

/var/lib/dynatrace/remotepluginmodule/log/extensions/datasources/{extension-name}/

Common Error Patterns

# Timeout — device not responding or firewall blocking
WARN  SNMP request timed out for device 10.0.0.1:161

# Auth failure — wrong community string or SNMPv3 credentials
ERROR SNMP authentication failure for device 10.0.0.1

# OID not found — device doesn't support this MIB
WARN  No such object: 1.3.6.1.4.1.9.9.109.1.1.1.1.8

# Table walk hang — device SNMP agent bug (our ACI case!)
WARN  SNMP GETBULK timeout after 180s for OID 1.3.6.1.2.1.2.2.1.2

The ACI Case Study

Real production issue we diagnosed from logs:

Device: 10.250.11.51 (Cisco ACI spine)
Symptom: CPU, memory, PSU, temperature = zero data
         sysUpTime = working fine (scalar OID)

Log pattern (repeating every 3 minutes):
  07:12:00 INFO  Starting poll for 10.250.11.51
  07:12:00 INFO  Scalar metrics collected (sysUpTime OK)
  07:12:01 INFO  Starting GETBULK walk for ifTable
  07:15:01 WARN  SNMP GETBULK timeout (180s) for ifDescr
  07:15:01 ERROR DEVICE_CONNECTION_ERROR for 10.250.11.51

Root cause: ifIndex 402718780 has a buggy SNMP agent response
            that hangs the ifDescr walk indefinitely.

Fix: Separate Interfaces into their own SNMP group (Module 3).
     CPU/Memory/PSU/Temp now poll independently.

Advanced Timeout Configuration

In the monitoring configuration JSON, tune per-device:

{
  "devices": [{
    "ip": "10.0.0.1",
    "port": 161,
    "authentication": { "type": "SNMPv2c", "community": "public" },
    "advanced": {
      "timeoutSecs": 5,
      "retries": 3,
      "maxRepetitions": 50,
      "maxOidsPerQuery": 60,
      "enableUnconnectedUdp": true
    }
  }]
}

Total time per query = timeoutSecs Ɨ (retries + 1). Default: 1s Ɨ 4 = 4 seconds. For slow devices, increase timeoutSecs to 5-10.

What's Next

In Module 5, we'll add topology — creating custom entity types (device, interface, power supply, sensor) with parent-child relationships so your data appears as navigable entities in Dynatrace, not just raw metrics.

šŸ›  Hands-On Exercise

Edit the YAML in the editor, then click "Check My Work" to validate.

Variables & Filters

Add user-configurable variables to this extension so operators can filter which interfaces are monitored.

  • Define a vars: section with an interface_filter variable (type: text)
  • Use filter: var:interface_filter on the if.name dimension
  • Add a second variable poll_interval of type enum with values 1 and 5

Variables appear in the monitoring configuration UI so operators can customize without editing YAML.

extension.yamlYAML
Loading...