Hi! This problem is not complicated, but it has been bothering me for a
long time. I hope you can help me! I currently have a network device that
needs to be monitored. I need to use the snmp exporter to obtain metrics
and send them to Prometheus. However, several metrics of this device
return Strings to snmp protocol. In order to obtain the correct results, I
can only set the type to DisplayString in the override in generator.yml:
overrides: runningStatus: type: DisplayString
Now I have two metrics:
① Running Status:
There only two values: "true" and "false". The snmp exporter will moniter
this metric and return:
runningStatus{runningStatus="true"} 1
② Success Rate:
It is a float value actually. The snmp exporter will moniter this metric
and return:
successRate{successRate="100.0"} 1
As can be seen, the value we want has been placed in the label, and the
metric has been returned with a meaningless 1 (at the end). However, *what
I hope is that the 1 at the far right end can be the metric I want*,
because in the existing monitoring system we are running, those metrics
needs to be saved to the system. On Prometheus, the values displayed in
this way can only be placed in labels, and the label values are not
convenient for statistical analysis.
*I hope to associate false with 0, true with 1, and present it in gauge in
①. In ②, change the numerical value displayed as a String type to gauge.*
The most common methods I have found are the relabel in Prometheus.yml. But
most of them only change the name of the Label using regularization, which
cannot achieve the desired effect.
There is a very similar question description, but its solution doesn't work
for me:
https://www.robustperception.io/numbers-from-displaystrings-with-the-snmp_exporter/
The method of this url will make it impossible for me to directly monitor
the metric! I cannot see the metric in the localhost:9116 following its
attempts.
I am a new user and need to add several monitoring metrics to a running
Prometheus + snmp exporter. This means that I cannot easily change the
system version or settings. The version of snmp is 0.20.0, prometheus is
2.6.0.
Thank you very much for your answer!
--
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 on the web visit
https://groups.google.com/d/msgid/prometheus-users/2a101521-d9a3-4147-b5bc-02e25f73475cn%40googlegroups.com.