--
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-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/7e971666-eeb6-4480-8010-5ffdd38b735c%40googlegroups.com.
Interesting to know, thank you.Currently the python code is somewhat hackable to customise its behaviour. It would need changing to take a YAML config with all useful permutations of filtering sites and devices. If I ever get some spare time, it will be a project...
Cheers... Brian.
--
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-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/62bdbf43-83ae-4da8-879b-7bb795891fc4%40googlegroups.com.
I have managed to get the snmp_targets.yml file. I was just wondering if there is any way for me to use this when starting prometheus?
- job_name: snmp
scrape_interval: 15s
file_sd_configs:
- files:
- /etc/prometheus/targets.d/snmp_targets.yml
metrics_path: /snmp
relabel_configs:
- source_labels: [__address__]
regex: '([^/]+)' # name or address only
target_label: instance
- source_labels: [__address__]
regex: '([^/]+)' # name or address only
target_label: __param_target
- source_labels: [__address__]
regex: '(.+)/(.+)' # name/address
target_label: instance
replacement: '${1}'
- source_labels: [__address__]
regex: '(.+)/(.+)' # name/address
target_label: __param_target
replacement: '${2}'
- source_labels: [__param_target]
regex: '\[(.+)\]' # remove [...] from address
target_label: __param_target
replacement: '${1}'
- source_labels: [module]
target_label: __param_module
- target_label: __address__
replacement: 127.0.0.1:9116 # SNMP exporter
- job_name: snmp
scrape_interval: 1m
file_sd_configs:
- files:
- /etc/prometheus/targets.d/snmp_targets.yml
metrics_path: /snmp
relabel_configs:
# When __address__ consists of just a name or IP address,
# copy it to both the "instance" label (visible to user)
# and "__param_target" (where snmp_exporter sends SNMP)
- source_labels: [__address__]
regex: '([^/]+)'
target_label: instance
- source_labels: [__address__]
regex: '([^/]+)'
target_label: __param_target
# When __address__ is of the form "name/address", extract
# name to "instance" label and address to "__param_target"
- source_labels: [__address__]
regex: '(.+)/(.+)'
target_label: instance
replacement: '${1}'
- source_labels: [__address__]
regex: '(.+)/(.+)'
target_label: __param_target
replacement: '${2}'
# If __param_target is enclosed by square brackets, remove them
- source_labels: [__param_target]
regex: '\[(.+)\]'
target_label: __param_target
replacement: '${1}'
# Copy "module" label to "__param_module" so that snmp_exporter
# receives it as part of the scrape URL
- source_labels: [module]
target_label: __param_module
# Send the actual scrape to SNMP exporter
- target_label: __address__
replacement: 127.0.0.1:9116
If you wanted to write that in Go, it could be directly integrated into Prometheus. As we have ended the new service discovery method moratorium. :-)
Just wondering while I'm here if you've got a link to installing a timescaledb to enable long-term storage of metric data from prometheus? I do not particularly want to use Docker and all the I have examples found online thus far have been using Docker.