dd-agent
dd-agent copied to clipboard
[snmp] Add support for OctetString
Working with OctetString types currently throws:
"Unsupported metric type OctetString"
For reference, the MIB being worked with (for Avaya Experience Portal) can be seen here - ftp://ftp.avaya.com/incoming/Up1cku9/tsoweb/voice_portal/AV-VOICE-PORTAL-MIB.txt
Many of the "metrics" from these OctetString values could be converted to a integer.
Hi @mjbruder!
By default the check can't determine if it should send OctetString
s as gauges or counters, hence the warning you get.
Have you tried setting the forced_type
parameter (see https://github.com/DataDog/dd-agent/blob/5.8.5/conf.d/snmp.yaml.example#L41) on the metric to gauge
or counter
(depending on the type of metric the snmp value should be sent as)?
If that doesn't work I'd recommend sending a flare to our support team so that we have all the info we need to troubleshoot.
@olivielpeau good to know! I'm assuming I can use forced_type on a MIB and not just an OID like in the example?
What about a MIB table where I'd like to force all the symbols to a gauge? Something like this:
metrics:
- MIB: AV-VOICE-PORTAL-MIB
table: avpMPPTable
symbols:
- avpMPPEntryRequestedState
- avpMPPEntryConfiguredState
- avpMPPEntryCurrentState
- avpMPPEntryCPUUsagePercent
- avpMPPEntryDiskUsagePercent
- avpMPPEntryMemoryUsagePercent
- avpMPPEntryActiveCalls
- avpMPPEntryCallsToday
forced_type: gauge
metric_tags:
- tag: mpp
column: avpMPPEntryName
@mjbruder: your example should work, that said one of the current limitations of setting forced_type
is that all the symbols
' values will be cast to integers and sent as either gauges or counters.
So you have to make sure that all the values you pull can be cast to integers by python's int()
function (see https://github.com/DataDog/dd-agent/blob/5.8.5/checks.d/snmp.py#L491-L496)
(for example the values 1.2
and 1%
wouldn't work currently)
OK, I still can't get any of the metrics to show up. I ran snmpwalk against them, and they could all be read as integers (no decimals and no % signs).
Hmm, that's unfortunate. We'll need your logs to troubleshoot this further.
Could you set the log_level
of the agent to DEBUG
, restart the agent and send over your logs using the flare command?
Thanks!
@mjbruder Have you got this to work? I'm facing the same issue now where even if I force_type: gauge
it still shows an error.
@lyonsy I don’t believe I ever got it working. I ended up using direct OIDs to get at the info I needed. Unfortunately I don’t have access to the system anymore, so I don’t have many details at my fingertips.