Comments (12)
- name: hrProcessorLoad
oid: 1.3.6.1.2.1.25.3.3.1.2
type: Integer32
indexes:
- labelname: cpu
type: Integer32
should do it offhand.
from snmp_exporter.
You match that to the table with the CPU core descriptions. Look at ifDescr
for how this works.
from snmp_exporter.
@brian-brazil For clarification: If you omit lookups
, the index simply assigns the last number in a OID to the label as its value?
from snmp_exporter.
It's two stages. Indexes extracts indexes as labels. Lookups lets you add/replace labels based on lookups of the tree.
from snmp_exporter.
Ah, neat. Never understood it that way, but makes sense in hindsight. Thanks :)
from snmp_exporter.
@paurullan Still, if you have a table with human-readable descriptions (unlikely in this specific case, mind), going via lookups might be preferable.
from snmp_exporter.
@brian-brazil fantastic, thank you. The example worked great for the CPUs.
Now I have another similar case but with a twist: the router exposes the traffic for the external ports in the same OID walk than the dynamic clients (it is behind a PON port). Currently it has more than 3500+ items, I only need a list of 20 and the exporter only outputs around a hundred.
@RichiH , you said «going via lookups» but I could not fully understand how. This is my draft; how would you do it?
metrics:
- name: portOutput
oid: 1.3.6.1.2.1.31.1.1.1.10
type: Integer32
indexes:
- labelname: port
type: Integer32
# lookups:
# - labels: [port]
# labelname: port
# values:
# - "11004"
# - "10204"
from snmp_exporter.
We talked about this two weeks ago and there has been no advance.
I will restate my problem so I make myself clear:
I have to retrieve only 20 items from a OID that has thousand of items. How can I select the individual items?
@RichiH talked about lookups but I could not make them work. How should I proceed?
from snmp_exporter.
@paurullan The Prometheus way is to simply ingest those few thousand values and then ignore them in your queries. It might be counter-intuitive at first, but unless you're already resource-constrained, it will incur the least cost; human attention tends to be more expensive than hardware, in the long run.
Lookups are orthogonal to that, they simply assign a string from the snmpbulkget instead of the last section of the OID.
from snmp_exporter.
@RichiH the problem is that doing a full snmp walk on that OID range takes more than 50 seconds.
But I found a way to cross the lookup with strings:
~$ snmpbulkget 10.40.0.10 -v 2c -c public 1.3.6.1.2.1.31.1
iso.3.6.1.2.1.31.1.1.1.1.101 = STRING: "Ethport 1/1/g1"
iso.3.6.1.2.1.31.1.1.1.1.102 = STRING: "Ethport 1/1/g2"
iso.3.6.1.2.1.31.1.1.1.1.103 = STRING: "Ethport 1/1/g3"
iso.3.6.1.2.1.31.1.1.1.1.104 = STRING: "Ethport 1/1/g4"
iso.3.6.1.2.1.31.1.1.1.1.201 = STRING: "Ethport 1/2/g1"
iso.3.6.1.2.1.31.1.1.1.1.202 = STRING: "Ethport 1/2/g2"
iso.3.6.1.2.1.31.1.1.1.1.203 = STRING: "Ethport 1/2/g3"
iso.3.6.1.2.1.31.1.1.1.1.204 = STRING: "Ethport 1/2/g4"
iso.3.6.1.2.1.31.1.1.1.1.301 = STRING: "Ethport 2/1/g1"
iso.3.6.1.2.1.31.1.1.1.1.302 = STRING: "Ethport 2/1/g2"
---
# Connection output for the PONs
default:
walk:
- 1.3.6.1.2.1.31.1.1.1.6
- 1.3.6.1.2.1.31.1.1.1.10
metrics:
- name: ifHCInOctets
oid: 1.3.6.1.2.1.31.1.1.1.6
indexes:
- labelname: ifMIBObjects
type: Integer32
lookups:
- labels: [ifMIBObjects]
labelname: ifMIBObjects
oid: 1.3.6.1.2.1.31.1
This solution gives me lots of unnecessary items but it will do.
Was this the lookup way you mentioned?
from snmp_exporter.
Hi @brian-brazil , I met this issue in my env as my OID output likes:
SNMPv2-SMI::enterprises.2011.6.3.4.1.2.0.2.0 = INTEGER: 61
SNMPv2-SMI::enterprises.2011.6.3.4.1.2.0.3.0 = INTEGER: 77
SNMPv2-SMI::enterprises.2011.6.3.4.1.2.0.4.0 = INTEGER: 14
SNMPv2-SMI::enterprises.2011.6.3.4.1.2.0.5.0 = INTEGER: 4
Index didn't work anymore due to the last number is always 0, any idea about this...
from snmp_exporter.
@Colstuwjx This should work fine, for usage questions, please us our community contacts. GitHub issues are for bugs/features only.
from snmp_exporter.
Related Issues (20)
- Inconsistent support of IPv6 literals
- Setting a non-default retries value for any module affects all modules
- servertech_sentry3 scraping broke between 0.20.0 and 0.21.0 HOT 13
- can‘t find gcc-g++ pkg in rhel HOT 3
- curl: option --no-progress-meter: is unknown
- Exec format error
- how to update snmp.yaml and do not restart snmp_expoter
- Override help string
- collected metric was collected before with the same name and label values HOT 6
- No specific metrics are generated
- error collecting metric Desc{fqName: "snmp_error", help: "Error scraping target", constLabels: {module="okiprinter"}, variableLabels: {}}: error walking target ipv4: not in time window
- snmp_exporter does not parse InetAddressIPv4z correctly
- yaml/yq parser round-trip behavior: unmarshaling of integer keys in dicts HOT 2
- Go build error when trying to generate "generator" file HOT 6
- Handle connection failures on resolution failure HOT 2
- 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
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.