IfDescr vs IfIndex

361 views
Skip to first unread message

juan.esc...@gmail.com

unread,
Nov 13, 2017, 8:32:03 PM11/13/17
to Prometheus Users
I’m trying to create a dashboard in grafana but I’m having a hard time when trying to use ifDescr. I can get it to pull the correct data when I create the query bit when I try to draw out the graph I get no data. I’m using snmp_exporter and there is data being collected and I can see it in a graph if I set it static.


I’ve tried both ifdescr and ifindex to show the data and neither work.

Juan Escudero

unread,
Nov 13, 2017, 10:08:20 PM11/13/17
to Prometheus Users
Here are some examples,
irate(ifHCInOctets{job='floor_switches',instance='$host',ifIndex='409'}[5m]) * 8  this works properly.  
irate(ifHCInOctets{job='floor_switches',instance='$host',ifDescr='$ifDescr'}[5m]) * 8 this does not work properly

Im not sure why when i try to use ifDescr it does not produce any data

Ben Kochie

unread,
Nov 14, 2017, 2:08:35 AM11/14/17
to Juan Escudero, Prometheus Users
Can you share the snmp.yml ifHCInOctets section?

--
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/f97aaca5-8c6b-460a-b1c7-ca7ac29fcd6a%40googlegroups.com.

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

Juan Escudero

unread,
Nov 14, 2017, 10:40:11 AM11/14/17
to Prometheus Users
- name: ifHCInOctets
oid: 1.3.6.1.2.1.31.1.1.1.6
type: counter
help: The total number of octets received on the interface, including framing
characters - 1.3.6.1.2.1.31.1.1.1.6
indexes:
- labelname: ifIndex
type: gauge

Ben Kochie

unread,
Nov 14, 2017, 10:56:31 AM11/14/17
to Juan Escudero, Prometheus Users
This mapping doesn't contain any ifDescr mapping, so you can only lookup by ifIndex.

In order to lookup by ifDescr, you either need to use a group_left join[0], or added it to the snmp.yml as a lookup[1].


--
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.

Juan Escudero

unread,
Nov 14, 2017, 12:09:56 PM11/14/17
to Prometheus Users
Thanks for the info. I got it to work using ifIndex but i will look into using lookups and group_left.
Reply all
Reply to author
Forward
0 new messages