Hello,
I scrape a network device via SNMP and snmp_exporter. scrape in general
works but some metrics needs some modification. This is not working.
I have this in my generator.yml:
modules:
# Cubro Packetbroker
cubroexa_mib_module:
walk: [cubro]
overrides:
deviceUptime:
ignore: true
cpuUtilization:
type: Float
regex_extracts:
Percent:
- regex: '([0-9.]+)'
value: '$1'
memUtilization:
type: Float
regex_extracts:
Percent:
- regex: '([0-9.]+)'
value: '$1'
I get this in my generated snmp.yml:
- name: cpuUtilization
oid: 1.3.6.1.4.1.32182.10.1.5
type: Float
help: This is cpu Utilization. - 1.3.6.1.4.1.32182.10.1.5
regex_extracts:
Percent:
- value: $1
regex: ^(?:([0-9.]+))$
- name: memUtilization
oid: 1.3.6.1.4.1.32182.10.1.7
type: Float
help: This is mem Utilization. - 1.3.6.1.4.1.32182.10.1.7
regex_extracts:
Percent:
- value: $1
regex: ^(?:([0-9.]+))$
This is from the MIB:
cpuUtilization OBJECT-TYPE
SYNTAX DisplayString
MAX-ACCESS read-only
STATUS current
DESCRIPTION "This is cpu Utilization."
::= { systemInfo 5 }
memUtilization OBJECT-TYPE
SYNTAX DisplayString
MAX-ACCESS read-only
STATUS current
DESCRIPTION "This is mem Utilization."
::= { systemInfo 7 }
without overrides the Prometheus Metric looks like this:
cpuUtilization{cpuUtilization="12.34%"} 1
cpuUtilization{cpuUtilization="9.4%"} 1
cpuUtilization{cpuUtilization="45.1%"} 1
My goal was to get this:
cpuUtilizationPercent{} 12.34
cpuUtilizationPercent{} 9.4
cpuUtilizationPercent{} 45.1
With the override enabled I get this:
cpuUtilization{} 0
cpuUtilization{} 0
cpuUtilization{} 0
Can someone please help me to understand what I did wrong and provide the
correct generator.yml ?
I added "offset: 1.4" as a test but the metric value is still 0 and not 1.4
In addition ist it expected that the regex in the generator is different
than in the snmp.yml afterwards?
Thank you very much in advance!
--
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 [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/prometheus-users/25b290f3-c003-4481-bd64-ce00ee378e69n%40googlegroups.com.