Prometheus Config for SNMP exporter

The configuration for the SNMP exporter inPrometheus should look like:

scrape_configs:
  - job_name: 'snmp'
    target_groups:
      - targets:
        - 192.168.1.2  # SNMP device.
    params:
      module: [default]
    relabel_configs:
      - source_labels: [__address__]
        regex: (.*?)(:80)?
        target_label: __param_address
        replacement: ${1}
      - source_labels: [__param_address]
        regex: (.*)
        target_label: instance
        replacement: ${1}
      - source_labels: []
        regex: .*
        target_label: __address__
        replacement: 127.0.0.1:9116  # SNMP exporter.

Add all your targets to the list of targets, or use service discovery.

Rate this tip

If you think this tip by bbrazilbbrazil is useful — rate it up!

rating: +1+x
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License