Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No Data Scraped by Prometheus #62

Open
TrikkStar opened this issue Sep 27, 2020 · 2 comments
Open

No Data Scraped by Prometheus #62

TrikkStar opened this issue Sep 27, 2020 · 2 comments

Comments

@TrikkStar
Copy link

After spending several hours trying to get this script working I'm at a loss as to what's going wrong.

Running Docker on RPi3 w/ latest Rasbian Lite. (Though I want to run both this container and Prometheus on a separate server, running it on the pi to eliminate variables)
Deployment:

$ API_TOKEN=$(awk -F= -v key="WEBPASSWORD" '$1==key {print $2}' /etc/pihole/setupVars.conf)
$ docker run --name pihole-exporter -d -p9617:9617 -e 'PIHOLE_HOSTNAME=192.168.1.13' -e "PIHOLE_API_TOKEN=$API_TOKEN" -e 'PORT=9617' -e 'INTERVAL=10s' ekofr/pihole-exporter:0.0.9
$ docker run --name prometheus -d -p 9090:9090 --mount source=prometheus,target=/etc/prometheus/ prom/prometheus

prometheus.yml:

# my global config
global:
  scrape_interval:     15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
  evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
  # scrape_timeout is set to the global default (10s).

# Alertmanager configuration
alerting:
  alertmanagers:
  - static_configs:
    - targets:
      # - alertmanager:9093

# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
  # - "first_rules.yml"
  # - "second_rules.yml"

# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
  # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
  - job_name: 'prometheus'

    # metrics_path defaults to '/metrics'
    # scheme defaults to 'http'.

    static_configs:
    - targets: ['localhost:9090']

  - job_name: 'pihole'
    honor_timestamps: true
    metrics_path: /metrics
    scheme: http
    static_configs:
    - targets: ['localhost:9617']
@garymcleanuk
Copy link

docker run --name pihole-exporter -d -p9617:9617 -e 'PIHOLE_HOSTNAME=192.168.1.13' -e "PIHOLE_API_TOKEN=$API_TOKEN" -e 'PORT=9617' -e 'INTERVAL=10s' ekofr/pihole-exporter:0.0.9

The bit in bold should be removed? This is the port of the admin page fo pi hole? Is that correct?

@eko
Copy link
Owner

eko commented Jan 1, 2021

Hi @garymcleanuk,

When the exporter is running, you can try to go on http://192.168.1.13:9617/metrics in order to see if metrics are well rendered.

In case metrics are available, you have an issue between Prometheus and the exporter, then you can go to http://192.168.1.13:9090/targets and see if the exporter target is UP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants