snmp_exporter - Trying to wrap my brain around overrides.

118 views
Skip to first unread message

Matt X

unread,
Feb 9, 2022, 4:26:46 AM2/9/22
to Prometheus Users
I'm reaching new levels of desperation with trying to get this working and I'm hoping someone here can point to a workable example.  So far, my efforts have been in vain for something that should be so simple.

The short of it is that I've got a generator controller that can read the ATS utility voltage and I want to plot this in Grafana.  I've got Grafana, Prometheus, and snmp_exporter set up, however it appears that snmp_exporter isn't playing very nice with the generator controller and instead of reading a DisplayString, it's interpreting it as a Gauge and only renders in Grafana as a 0 or a 1 which is less than useful considering that the grid changes in voltage anywhere from 0 to almost 280V.

When I poll the device using snmpget, I get the below:

# snmpget -v1 -c SECRET HOSTNAME GenMon-MIB::utilityVoltage
GenMon-MIB::utilityVoltage = STRING: 249

(In this case, the ATS is reading 249 volts).

When I poll the controller  in snmp_exporter's web-UI, I get the below result:

# HELP utilityVoltage The current utility voltage from the ATS. # TYPE utilityVoltage gauge utilityVoltage{utilityVoltage="249"} 1

(The ATS is still returning 249V, it does fluctuate).

I've tried many searches online for how to implement an override so I can get the value as an integer, but so far, none of them have produced any favorable result. Normally I just get snmp_exporter errors and the exporter won't start until I remove the override definition.

Here is my current snmp.yml:
genmon:
  walk:
  - 1.3.6.1.4.1.58399
  get:
  - 1.3.6.1.2.1.1.1.0
  - 1.3.6.1.2.1.1.2.0
  - 1.3.6.1.2.1.1.3.0
  metrics:
  - name: utilityVoltage
    oid: 1.3.6.1.4.1.58399.1.0.1.1
    type: DisplayString
    help: The current utility voltage from the ATS.
  version: 1
  auth:
    community: SECRET
(For some reason, Google stripped out the space indentations, it is indented correctly)

Any advice on how I can fix this?  If I can figure out this one override, I can do the rest of them that I want to implement, I'm just racking my brain on how to do this as none of the how-to's I've read describe how to use an override that actually works.

Thank you for your time!
Reply all
Reply to author
Forward
0 new messages