Comments (12)
I've made an alternative default module on https://github.com/alfh/snmp_exporter/tree/master_use_ifname_instead_of_ifdescr
This works fine for me.
I you think this makes sense, I can make a pull request.
Alternatively, I could make a couple of "sed" expressions, which one could add to the documentation, to switch from using ifDescr to ifName in the whole snmp.yml file.
Comments appreciated
Alf
from snmp_exporter.
The reason ifDescr
is used is because that is what many switches use, instead of ifName
.
You can include both the index and description labels by doing something like this:
- name: ifSpeed
oid: 1.3.6.1.2.1.2.2.1.5
indexes:
- labelname: ifIndex
type: Integer32
lookups:
- labels: [ifIndex]
labelname: ifDescr
oid: 1.3.6.1.2.1.2.2.1.2
This will keep the ifIndex
label for SNMP uniqueness, and ifDescr
for labeling.
You could include both by doing this mapping:
- name: ifSpeed
oid: 1.3.6.1.2.1.2.2.1.5
indexes:
- labelname: ifIndex
type: Integer32
lookups:
- labels: [ifIndex]
labelname: ifDescr
oid: 1.3.6.1.2.1.2.2.1.2
- labels: [ifIndex]
labelname: ifName
oid: 1.3.6.1.2.1.31.1.1.1.1
from snmp_exporter.
Yes, you can remove the lookups.
In this case you should probably be using the node exporter as that looks to be a Linux box.
from snmp_exporter.
I realize the node exporter would be better however I have a large number of production systems that already have snmpd running on them and because of internal QA processes it's going to take a fair bit of time before I can actually roll it out.
In the mean time I would like to start gathering metrics with SNMP.
If I remove the lookups how would the interfaces be identified within prometheus?
Does the following comment #37 (comment) require a patch to the exporter to implement $ifDescr ($index) or can it be done with a config modification?
from snmp_exporter.
If I remove the lookups how would the interfaces be identified within prometheus?
By number, 1-4 in this case. It's just a config change.
from snmp_exporter.
Hi
I have the same issue, I have virtual machines (linux) with several network interfaces, all using SR_IOV, so they have virtual network cards (intel igbvf), tied to a physical network card (intel igb) on the host.
So I get name collision on ifDescr, since all virtual cards have the same description.
Why do you use ifDescr and not ifName ?
Is this because the "default" module is more geared towards network hardware (routers, switches) and not computers (linux or other OSes) ?
(I will try to replace all ifDescr with ifName, and see how that looks)
I know I could run the "node exporter" on my linux machines, but I want to use the SNMP infrasturcture I have in place already.
Maybe there should be a defaultlinux module, which uses the ifName instead of ifDescr ?
If time permits, I will also look into making a module exposing metrics for Eaton UPSes, using SNMP.
Here is some sample output from my virtual router, running IPFire on Linux.
ifName
[alf@somehost ~]$ snmpwalk -v2c -c .... 192.168.1.1 |grep IF-MIB | grep ifName
IF-MIB::ifName.1 = STRING: lo
IF-MIB::ifName.2 = STRING: green0
IF-MIB::ifName.3 = STRING: red0
IF-MIB::ifName.4 = STRING: blue0
IF-MIB::ifName.5 = STRING: imq0
ifDescr
[alf@somehost ~]$ snmpwalk -v2c -c ... 192.168.1.1 |grep IF-MIB | grep ifDesc
IF-MIB::ifDescr.1 = STRING: lo
IF-MIB::ifDescr.2 = STRING: Intel Corporation I350 Gigabit Network Connection
IF-MIB::ifDescr.3 = STRING: Intel Corporation I350 Gigabit Network Connection
IF-MIB::ifDescr.4 = STRING: Qualcomm Atheros AR9287 Wireless Network Adapter (PCI-Express)
IF-MIB::ifDescr.5 = STRING: imq0
from snmp_exporter.
I had to edit the Grafana Dashboard, https://grafana.net/dashboards/1124, replacing all ifDescr with ifName, to get the grafing to look like before.
So maybe I should just leave the ifDescr label, but only change the actual OID used, to point it to ifName instead of ifDescr ?
Comments ?
Alf
from snmp_exporter.
In my case I'm also interested in additional metrics from the systems such as CPU, memory and disk activity. It would be nice if there already was a linux module that covered all the standard OIDs.
from snmp_exporter.
@wtip We do not recommend using SNMP for Linux, the node_exporter covers these things in much higher detail, with less overhead.
from snmp_exporter.
@SuperQ I understand. See my earlier comment #92 (comment)
I have about 180 linux servers I need to monitor. I would rather have some metrics than no metrics.
from snmp_exporter.
@SuperQ So I ran into this issue again when trying to monitor several Dell PowerConnect switches. They all return this.
An error has occurred during metrics gathering:
786 error(s) occurred:
* collected metric ifHCOutMulticastPkts label:<name:"ifDescr" value:"Ethernet Interface" > untyped:<value:0 > was collected before with the same name and label values
* collected metric ifConnectorPresent label:<name:"ifDescr" value:"Ethernet Interface" > untyped:<value:1 > was collected before with the same name and label values
* collected metric ifHCOutMulticastPkts label:<name:"ifDescr" value:"Ethernet Interface" > untyped:<value:0 > was collected before with the same name and label values
* collected metric ifMtu label:<name:"ifDescr" value:"Ethernet Interface" > untyped:<value:10240 > was collected before with the same name and label values
* collected metric ifOutDiscards label:<name:"ifDescr" value:"Ethernet Interface" > untyped:<value:0 > was collected before with the same name and label values
......
So I think it would make sense for the default module to use your last suggestion of having both the ifDescr and ifName as the label
from snmp_exporter.
With the version at head, you can try the default_ifname and default_ifentry modules to see if they work.
from snmp_exporter.
Related Issues (20)
- Sonicwall Firewall / snmp exporter / prometheus
- Generator - get without .0 + unwanted walk
- Make generator error 22 when downloading PICO-IPSEC-FLOW-MONITOR-MIB.txt HOT 1
- Can snmp_exporter read metrics from UPS Schneider ? HOT 3
- Extreme switch id not found
- SNMPv2 Expansion of Environment Variables
- Generator does not pick up eaton mibs
- Help needed creatinging custom generator.yml
- Specifying --config.file=~/snmp_exporter/generator/snmp.yml does not work
- Scans are slow every 5 minutes, with a single retry HOT 13
- MIB Table non-read-only indexes Get ?
- Scrape Interval Setting HOT 1
- IP-MIB atNetAddress Parsing error
- Problem in snmp.yml: field scale not found in type config.Metric HOT 2
- Cut a release HOT 6
- data never changes on exporter HOT 2
- Module mikrotik:error in unmarshalResponse: expected a sequence when unmarshalling a VB, got 2
- use_unconnected_udp_socket problem?
- Can't manually pull tags from OID
- Lookups returning empty strings when use the index lookup cdpCacheDeviceId
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from snmp_exporter.