snmp_exporter and ifDescr/ifAlias

775 views
Skip to first unread message

robu...@gmail.com

unread,
Oct 20, 2017, 4:48:42 AM10/20/17
to Prometheus Users
hi

I would like to monitor my switches with prometheus.
while the snmp_exporter works fine and I get my data with a query like

irate(ifInOctets{instance="my.switch.test", ifIndex=~"[1-9][0-9]?"}[5m])

I can't figure out how to get the fields ifDescr or ifAlias into the legend in grafana.

It would be most useful if one could see on first glance which interface produces this spike, or has the highest rate,
without having to have a translation table somewhere to lookup the ifAlias for this ifIndex.

How can I get ifDescr/ifAlias in the legend? (if it is possible at all)

TIA

Brian Brazil

unread,
Oct 20, 2017, 5:40:20 AM10/20/17
to robu...@gmail.com, Prometheus Users
You need to use group_left to add in the label, so irate(...) * ignoring(ifAlias) group_left(ifAlias) ifAlias

This is the same technique as https://www.robustperception.io/exposing-the-software-version-to-prometheus/

--

robu...@gmail.com

unread,
Oct 20, 2017, 6:31:28 AM10/20/17
to Prometheus Users
BRILLIANT!

thnx Brian! And thnx also for the blog, btw.
The promql seems to be quite powerful but the available documentation rather thin,
so your blog helps a lot.
(Might be time for an PocketReference/ShortCut ;-)

Brian Brazil

unread,
Oct 20, 2017, 6:54:35 AM10/20/17
to robu...@gmail.com, Prometheus Users
On 20 October 2017 at 11:31, <robu...@gmail.com> wrote:
BRILLIANT!

thnx Brian! And thnx also for the blog, btw.
The promql seems to be quite powerful but the available documentation rather thin,
so your blog helps a lot.
(Might be time for an PocketReference/ShortCut ;-)



On Friday, October 20, 2017 at 11:40:20 AM UTC+2, Brian Brazil wrote:
On 20 October 2017 at 09:48, <robu...@gmail.com> wrote:
hi

I would like to monitor my switches with prometheus.
while the snmp_exporter works fine and I get my data with a query like

irate(ifInOctets{instance="my.switch.test", ifIndex=~"[1-9][0-9]?"}[5m])

I can't figure out how to get the fields ifDescr or ifAlias into the legend in grafana.

It would be most useful if one could see on first glance which interface produces this spike, or has the highest rate,
without having to have a translation table somewhere to lookup the ifAlias for this ifIndex.

How can I get ifDescr/ifAlias in the legend? (if it is possible at all)


You need to use group_left to add in the label, so irate(...) * ignoring(ifAlias) group_left(ifAlias) ifAlias

This is the same technique as https://www.robustperception.io/exposing-the-software-version-to-prometheus/

--

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/d06f80bd-290f-431d-8c14-6b268aea3e74%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

robu...@gmail.com

unread,
Oct 23, 2017, 9:01:06 AM10/23/17
to Prometheus Users
;-) sort of ...
why not a collection of useful query s - taken from the real world - with some explanation.
like your hint above, I think A LOT people would like to see ifDescr/ifAlias 
thnx 


On Friday, October 20, 2017 at 12:54:35 PM UTC+2, Brian Brazil wrote:
On 20 October 2017 at 11:31, <robu...@gmail.com> wrote:
BRILLIANT!

thnx Brian! And thnx also for the blog, btw.
The promql seems to be quite powerful but the available documentation rather thin,
so your blog helps a lot.
(Might be time for an PocketReference/ShortCut ;-)


Brian 

--

Ben Kochie

unread,
Oct 23, 2017, 12:58:15 PM10/23/17
to robu...@gmail.com, Prometheus Users
It's possible to append multiple labels with a slightly modified config.  This is useful for things like SNMP, where the source data is a bit messy, because vendors. ;-)



--
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+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.

Jeffrey Ollie

unread,
Oct 23, 2017, 3:33:13 PM10/23/17
to Ben Kochie, robu...@gmail.com, Prometheus Users


For more options, visit https://groups.google.com/d/optout.



--
Jeff Ollie
The majestik møøse is one of the mäni interesting furry animals in Sweden.
Reply all
Reply to author
Forward
0 new messages