You can use file_sd_config:

- labels:
    module: mib_foo
  targets:
    - 1.2.3.4
    - 1.2.3.5
- labels:
    module: mib_bar
  targets:
    - 1.2.3.6
    - 1.2.3.7

Then use a relabelling config to copy label "module" to "__param_module"

  - 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__]
        target_label: instance
      - source_labels: [__address__]
        target_label: __param_target
      - source_labels: [module]
        target_label: __param_module
      - target_label: __address__
        replacement: 127.0.0.1:9116  # SNMP exporter

This will let you define a single prometheus job which can query many 
different types of device.

It's still going to be your job to use the generator tool to convert MIBs 
into snmp.yml form suitable for use with snmp_exporter.  Sorry, there's no 
avoiding that.

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/83fb858a-314f-4f9b-a31d-dad18464c87b%40googlegroups.com.

Reply via email to