Thanks, I'll try this.  I hadn't thought of graphing with the ==1 piece.
However, when I try this as EnumAsStateSet, it always has a value of 0 like
this:
cp850BitstreamFormat{cp850BitstreamFormat="0"} 1

I think this is because the OID is defined as OctetString, so I first need
to decode the hex to ASCII and then turn it into enum.  Is this possible?
An example from snmpwalk:
$ snmpwalk -v2c -c public -m DOLBY-CP850-MIB 10.49.51.30
1.3.6.1.4.1.6729.2.1.1.1.3.2.4 -Ox
DOLBY-CP850-MIB::cp850BitstreamFormat.0 = Hex-STRING: 70 63 6D

The mib is called DOLBY-CP850-MIB.  I've attached it here with its
dependencies.

On Tue, Aug 15, 2023 at 11:14 PM Ben Kochie <sup...@gmail.com> wrote:

> Prometheus is perfectly suited for these string values. The semi-static
> boolean 0/1 values compress very well, making it very efficient to store in
> the TSDB.
>
> There are three ways to handle this in the snmp_exporter. Default
> DisplayString as you have it, EnumAsInfo, and EnumAsStateSet.
>
> EnumAsInfo is useful for strings that you don't expect to change often /
> at all.
>
> EnumAsStateSet is useful for metrics where you are expecting the state to
> change. I'm guessing for your use case you want to use this one.
>
> Once you have this, you will get 8 series, but they will have a 0 or 1 for
> which the ENUM is set. Then you can graph 'cp850BitstreamFormat == 1' to
> view which is active.
>
> It would help if you posted a link to the MIB, as it would help to
> understand the underlying data.
>
> On Wed, Aug 16, 2023 at 7:06 AM 'Elliott Balsley' via Prometheus Users <
> prometheus-users@googlegroups.com> wrote:
>
>> As I'm evaluating Prometheus for SNMP monitoring, it seems like it's not
>> well suited for tracking string values.  Is that correct, or can anyone
>> share how it's working for them?
>> As an example, I'm monitoring a Dolby CP850 and one of the metrics is
>> returned like this:
>>
>> cp850BitstreamFormat{cp850BitstreamFormat="dolbyAtmos"} 1
>>
>> There are 8 possible string values for that one.  This OID type is
>> OctetString, and I am overriding to be DisplayString.  So this becomes 8
>> separate time series, which is very hard to graph appropriately.  My goal
>> is to track this (among other similar metrics) on a State Timeline in
>> grafana, where the key on the Y axis is "Bitstream Format" and the values
>> shows "dolbyAtmos", "pcm", "dolbyDigital", etc.
>>
>> I appreciate any ideas!
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Prometheus Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to prometheus-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/prometheus-users/CALajkdjJ_raGUTtfTmg9RGtBAWAcHuYoNz7CMm%3DfWuhBbEFocQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/prometheus-users/CALajkdjJ_raGUTtfTmg9RGtBAWAcHuYoNz7CMm%3DfWuhBbEFocQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to prometheus-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/CALajkdhqy7CLpcpO0Wi-8u%3DUGCjFK60w2r8%3DUJS%2BsOX4JsomnA%40mail.gmail.com.

<<attachment: DOLBY_CP850_MIB_FILES.zip>>

Reply via email to