Skip to content

Getting error in prometheus target snmp-exporter endpoint #882

Closed Answered by kalid-kto
kalid-kto asked this question in Q&A
Discussion options

You must be logged in to vote

The problem was... that i didn't define correctly the job_name in prometheus.yml.
Prometheus was unable to connect to the SNMP exporter on localhost port 9116. This is likely because Docker Compose is assigning the SNMP exporter a host name. I should have used the name of the service, defined in the docker-compose.yml

I only change replacement: snmp-exporter:9116 instead of replacement: localhost:9116 and worked as I spected

- job_name: snmp-exporter
  static_configs:
    - targets:
      - ip.ip.ip.ip  # SNMP device.
  metrics_path: /snmp
  params:
    module: [ups]    
  relabel_configs:
    - source_labels: [__address__]
      target_label: __param_target
    - source_labels: [__param_…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by kalid-kto
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants