scrape_configs: - job_name: 'snmp' static_configs: - targets: - 172.16.185.55 # SNMP device. metrics_path: /snmp params: module: [if_mib] relabel_configs: - source_labels: [__address__] target_label: __param_target - source_labels: [__param_target] target_label: instance - target_label: __address__ replacement: 127.0.0.1:9116 # SNMP exporter.
- job_name: 'snmp'
static_configs:
- targets:
- 172.16.185.55 # SNMP device.
metrics_path: /snmp
params:
module: [if_mib]
relabel_configs:
- source_labels: [__address__]
regex: .*
target_label: __param_target
- source_labels: [__param_target]
regex: .*
target_label: instance
- target_label: __address__
regex: .*
replacement: 127.0.0.1:9116 # SNMP exporter.When I change to:
- job_name: 'snmp'
target_groups:
- targets: ['172.16.185.55'] # SNMP device.
metrics_path: /snmp
params:
module: [if_mib]
relabel_configs:
- source_labels: [__address__]
regex: .*
target_label: __param_target
- source_labels: [__param_target]
regex: .*
target_label: instance
- target_label: __address__
regex: .*
replacement: 127.0.0.1:9116 # SNMP exporter.
The promtool check-config reports no issues.
But the Prometheus Status page of course have to target for the exporter:
| http://127.0.0.1:9116/snmp module="if_mib" | DOWN | none | 3.727106627s ago | server returned HTTP status 400 Bad Request |
So basically this all boils down to: How to properly configure snmp_exporter?/ Robert Nilsson
Hi, I'm quite new to Prometheus but so far I've managed to solve any issues. However I'm facing some problems with snmp_exporter.Basically I only want to monitor cisco switches with it.
But when I use the suggested configuration in prometheus.yml I get FAILED: relabel configuration requires a regular expression.
--
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/20533b80-ef83-414c-a104-4b2a00aa3c08%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To post to this group, send email to promethe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/20533b80-ef83-414c-a104-4b2a00aa3c08%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I'm running version:prometheus -version
prometheus, version 0.16.2+ds (branch: debian/sid, revision: 0.16.2+ds-1ubuntu1)
build user: pkg-go-maintainers@lists.alioth.debian.org
build date: 20160408-04:15:29go version: go1.6
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/0b59d27c-de15-480d-bbe9-4ce6ed9cbba4%40googlegroups.com.
| snmp | ||||
|---|---|---|---|---|
| Endpoint | State | Labels | Last Scrape | Error |
| http://127.0.0.1:9116/snmp module="if_mib" target="172.16.185.55" | DOWN | instance="172.16.185.55" | 13.642s ago | context deadline exceeded |
On 14 September 2017 at 08:57, <rob...@irob.se> wrote:
I'm running version:prometheus -version
prometheus, version 0.16.2+ds (branch: debian/sid, revision: 0.16.2+ds-1ubuntu1)
build user: pkg-go-ma...@lists.alioth.debian.org
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/0b59d27c-de15-480d-bbe9-4ce6ed9cbba4%40googlegroups.com.
Thanks Brian,I added the Ubuntu artful Repo which contains 1.7.1 and got one step closer to success however now Prometheus reports:
snmp Endpoint State Labels Last Scrape Error http://127.0.0.1:9116/snmp
module="if_mib" target="172.16.185.55"DOWN instance="172.16.185.55" 13.642s ago context deadline exceeded
I'm using a custom snmp community but could not find any default community string in snmp.yml.
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/94cec4b8-cd16-42aa-ab61-171e409ebef1%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/94cec4b8-cd16-42aa-ab61-171e409ebef1%40googlegroups.com.
modules: module_name: # The module name. You can have as many modules as you want. walk: # List of OIDs to walk. Can also be SNMP object names or specific instances. - 1.3.6.1.2.1.2 # Same as "interfaces" auth: # Community string is used with SNMP v1 and v2. Defaults to "public". community: FooBar
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/df29dadf-32e5-47ca-bff9-06f3e726fd3b%40googlegroups.com.