dd-agent icon indicating copy to clipboard operation
dd-agent copied to clipboard

[snmp] Add support for OctetString

Open mjbruder opened this issue 8 years ago • 9 comments

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.

mjbruder avatar Aug 03 '16 19:08 mjbruder

Hi @mjbruder!

By default the check can't determine if it should send OctetStrings 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 avatar Aug 04 '16 09:08 olivielpeau

@olivielpeau good to know! I'm assuming I can use forced_type on a MIB and not just an OID like in the example?

mjbruder avatar Aug 04 '16 15:08 mjbruder

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 avatar Aug 04 '16 15:08 mjbruder

@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)

olivielpeau avatar Aug 04 '16 15:08 olivielpeau

(for example the values 1.2 and 1% wouldn't work currently)

olivielpeau avatar Aug 04 '16 15:08 olivielpeau

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).

mjbruder avatar Aug 04 '16 18:08 mjbruder

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!

olivielpeau avatar Aug 05 '16 18:08 olivielpeau

@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 avatar Sep 27 '17 14:09 lyonsy

@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.

mjbruder avatar Oct 19 '17 13:10 mjbruder