Comments (35)
@JonAnder83 did you edit each graph to be Prometheus?
Nope. Funny thing: If you have multiple data sources (i.e. influxdb and prometheus) and set prometheus as the default data source, the import just works out of the box.
If other data source, i.e.: grafana is your main data source while importing, you will have to re-select data source editing all the elements of the dashboard and then, format them appropriately.
Thanks though!
from pihole-exporter.
Have you added a scrape job to the prometheus.yml? Something like:
- job_name: pihole
honor_timestamps: true
metrics_path: /metrics
scheme: http
static_configs:
- targets:
- pihole-exporter.mydomain.com
If so, on the targets page of Prometheus, is the endpoint marked as up?
from pihole-exporter.
Have you added a scrape job to the prometheus.yml? Something like:
- job_name: pihole honor_timestamps: true metrics_path: /metrics scheme: http static_configs: - targets: - pihole-exporter.mydomain.com
i filled up, like on instruction page, but no success. If you have experience in this can i invite you for a remote help or something else? it might be very useful to know it must be configured step by step. Any help is preciated.
from pihole-exporter.
@JeromeX Do you have your prometheus server running on the same machine as the pi-hole-exporter?
if this is the case then you need to set your domain to localhost
and don't forget the port 9617
- job_name: pihole
honor_timestamps: true
metrics_path: /metrics
scheme: http
static_configs:
- targets: ["localhost:9617"]
from pihole-exporter.
Probably the same issue:
#28
from pihole-exporter.
Finally it's working - Yes :-)
One more question to all freaks out there... How do i run automaticlly "pihole-exporter HTTP server" with command: ./pihole_exporter -pihole_hostname 192.168.178.2 -pihole_password blablabla in the background, to work with ssh on terminal? Please send me a quickfix. Many thanks folks!
from pihole-exporter.
I mostly followed this:
https://www.observability.blog/monitoring-pi-hole-with-prometheus/
If you did everything else, then you need to make the service and start it.
sudo nano /lib/systemd/system/pihole_exporter.service
Put in this, with the appropriate paths and user:
[Unit]
Description=pihole_exporter
[Service]
ExecStart=/opt/pihole_exporter/pihole_exporter-linux-amd64
WorkingDirectory=/opt/pihole_exporter
Restart=always
User=pihole_exporter
[Install]
WantedBy=multi-user.target
And then these commands to enable it to automatically start on boot and to start it now, without having to wait for a reboot:
sudo systemctl daemon-reload
sudo systemctl start pihole_exporter
sudo systemctl enable pihole_exporter
from pihole-exporter.
Mission completed, many thanks ๐ฏ , just forgot to create the service : Works perfectly on my Raspberry Pi 4.
Last question: Can anyone tell my if is possible to add the "Query Log" into dashboard?
Right now my dashboard looks like this, it's a mix with Prometheus and Influx. Thanks JX!
from pihole-exporter.
To do a query? Or do just see the 'up to 100 queries'? Depending on your network, you will never really see anything with the number of DNS requests that are made at any given time. Plus the dashboard isn't 'live' data, like constant, scrolling DNS requests.
You could edit the dashboard, and a a link to http://pi-hole-ip-or-address/admin/queries.php to get to the page.
Maybe make a feature request because it's not one of the data points (metrics registered) that the pihole_exporter handles.
from pihole-exporter.
I see a couple of issues while deploying mine.
First, I had to modify the systemd unit and add
ExecStart=/opt/pihole_exporter/pihole_exporter-linux-amd64 -pihole_hostname 192.168.20.254 -pihole_password xxxxxxxxxxx
Then, the dashboard import json from grafana web is different than the one here, in GitHub. While this one lets me select Prometheus as the data source, I still get no data on my dashboard.
Any help?
Sorry for piggybacking on this post but I didn't see it fit to open yet another thread with the same issue.
Thanks!
from pihole-exporter.
I'm having a similar issue to you @JonAnder83 however, after adding the rule you had, I got the following:
Any idea on how to fix this?
Thanks :)
from pihole-exporter.
@JonAnder83 did you edit each graph to be Prometheus?
@OfficialTehlo what hardware are you running? On a Pi itself? In a VM? Make sure the pihole_exporter is for your hardware. Did you follow the steps in the observability.blog link above with creating the user, etc.? The ExecStart line needs to be customised for your environment with the right executable, the right host, and the right password.
from pihole-exporter.
Hi @rth9 yes I have, because when I run the command by itself, then I get the following:
So on its own it's working fine, but in a systemd it isn't.
from pihole-exporter.
You are using the exact same command to start it manually as you put in the ExecStart line? Issue #26 shows the same error?
from pihole-exporter.
@rth9 Yep, same command but still have the same issue. Any idea?
from pihole-exporter.
Tried this once before and even today getting back to it, I'm still lost on how to make it show up in the graph.
Tried a few things which still didn't work and then all of a sudden, it works but not the way it should work.
Just banjo green graphs and statistics that doesn't mean anything.
Using Docker-Compose in case anyone is wondering.
p 9617 in web view, 404 page not found
I have it working on Prometheus,
Tried using ./pihole_exporter -pihole_hostname 192.168.178.2 -pihole_password blablabla
but no idea where' im placing that cmd in.
Unless its the same as this here... @TehloWasTaken #32 (comment)
Can't bash into Ekofr-Pi-Hole
from pihole-exporter.
If this works (make sure to change path to your executable and if it's not AMD64), I put single quote around my password:
/opt/pihole_exporter/pihole_exporter-linux-amd64 -pihole_hostname IP_ADDRESS -pihole_password 'PASSWORD'
Then you can do the following should work to get it as a service.
File path/name:
/lib/systemd/system/pihole_exporter.service
I prefer nano, so:
sudo nano /lib/systemd/system/pihole_exporter.service
And put in these contents (mine is AMD64, your file may be different architecture or location), it requires that you created the "pihole_exporter" user account manually.:
[Unit]
Description=pihole_exporter[Service]
ExecStart=/opt/pihole_exporter/pihole_exporter-linux-amd64 -pihole_hostname IP_ADDRESS -pihole_password 'PASSWORD'
WorkingDirectory=/opt/pihole_exporter
Restart=always
User=pihole_exporter[Install]
WantedBy=multi-user.target
Command to enable it as a service and auto-start on boot:
sudo systemctl enable pihole_exporter
You can then start it with this if you don't want to reboot:
sudo systemctl start pihole_exporter
Looking at the status of the service or using journalctl should show essentially the same output as running the command manually. Don't run the command manually when the service is started.
from pihole-exporter.
Actually, somehow when i looked into it on where the graph was coming from. it was from Grafana itself and not from the Prometheus.
- docker compose/ armfh
from pihole-exporter.
So you are using the ARM binary? Where my example above has amd64, you have replaced the commands to point to the arm binary? Your screenshot has a tick beside Prometheus, not Grafana, are you sure it's looking at the wrong place? I ran into a problem where my default was InfluxDB, I added Prometheus after, but had to update my dashboard to point to Prometheus instead of InfluxDB. Are you saying your default datasource was Grafana instead of InfluxDB or Prometheus?
from pihole-exporter.
I had just recently added InfluxDB to try it out which im not getting much out of it.
the 1st pic was under default. Not sure how it got bumped there so i had put it back to Prometheus which resulted no graph.
I'de assumed default was grafana itself resulted the green graph pic.
this is where im at. Tottaly ignoring InfluxDB
from pihole-exporter.
So you have data. I ended up going to edit the dashboard, not each graph, then JSON Model, copy and paste out, find and replace where it said "datasource": "default", and replaced it with "datasource": "Prometheus", and then copied and pasted it back in. That cleared up my graphs showing no or wrong data.
from pihole-exporter.
ok. Changed one and looks like it replaced all of them for me except "datasource": null , which I had also replaced.
Nothing so far. unless its 9311 the culprit.
https://pastebin.com/BpjUVzeD
from pihole-exporter.
Mine is still null and mine is also 9311.
Your dashboard now is filled with graphs with no data? Not odd stuff like with InfluxDB or Grafana previously?
Edit:
I can select a node, above the green square and below the title, you don't see this?
from pihole-exporter.
Its just blank.
https://streamable.com/cfdd89
Which node?
edit..perhaps i should just give up on it. nice feature to look at.
from pihole-exporter.
@JeromeX Do you have your prometheus server running on the same machine as the pi-hole-exporter?
if this is the case then you need to set your domain to
localhost
and don't forget the port9617
- job_name: pihole honor_timestamps: true metrics_path: /metrics scheme: http static_configs: - targets: ["localhost:9617"]
Where can i find the prometheus.yml to update the target?
from pihole-exporter.
from pihole-exporter.
Where can i find the prometheus.yml to update the target?
Can find this in /etc/prometheus/prometheus.yml
on your typical install.
from pihole-exporter.
Where can i find the prometheus.yml to update the target?
Can find this in
/etc/prometheus/prometheus.yml
on your typical install.
I'm running the exporter as an docker image. So i'm not able to find the yml under this path. Is it somewhere else located in this case?
from pihole-exporter.
@lkshck
I had to locate the yml file online since on my end in my docker, it couldn't create it for some reason.
After moving it and restarting it some how created another file I believe but didn't look into it before I had deleted it, oops.
but basically, u need to draw a path from host to path in docker of the oppose file in the container to make adjustments.
@rth9
After moving stuff to host to make sure everything is good, decided to goto the other pihole_exporter-1, part of the field has been inputing graph, the rest blank, took part of the code metrics and paste it into Pi-Hole Exporter and Boom, its there, sucks having to put everything by manual instead of auto set. Metrics are left blank.
Honestly, this could be alot better tho for the default without putting in so much tweaking into it. and the error of % ads blocked "O.toFixed is not a function" when selecting Premethuis
(selected a dupe for Domain being blocked)
from pihole-exporter.
Using now the typical installation of Prometheus and target looks ok from my point of view, but still HTTP Error Not Found. Any other ideas? Curl to 127.0.0.1:9617/metrics works fine on Pi.
Recognized that URL in grafana http://localhost:9090 is working and dashboard looks like the following. How is this possible? :D
from pihole-exporter.
@lkshck you don't want to add the /metrics
to your datasource setup. Just the http://localhost:9090 is enough for it to draw the data out of Prometheus.
from pihole-exporter.
@TehloWasTaken did that and i was able to save the datasource and dashboard is showing some data but not all of them. I thought i need to define http://localhost:9617 as i defined this in the prometheus job. Dashboard now looks like the following:
from pihole-exporter.
@lkshck Looks like it's getting there! I'd make sure the missing metrics are in Prometheus, if they are not they will simply not be exported from your PiHole.
Also, holy crap you block a lot of domains. You do know that more != better for PiHole right? ๐
from pihole-exporter.
@TehloWasTaken Yes I'm aware of that ๐ didn't found the best list setup for now.
As i'm not that familiar with Prometheus. Any way to check if the is in Prometheus? Like Top queries by domain..
from pihole-exporter.
besides the last 2 post between my pic and your pic, we both up to 1787115 @lkshck
from pihole-exporter.
Related Issues (20)
- pihole_forward_destination metric is showing wrong pair values HOT 1
- promtail config? HOT 2
- pihole-exporter crashes unexpactedly HOT 1
- isn't there an arm64 version? HOT 2
- Log level inflation: debugging data is output as info HOT 1
- Grafana Dashboard for Influxdb2
- Add a -version flag HOT 1
- pihole-exporter kill himself because of pihole unreachable HOT 1
- Pi-Hole Exporter stuck at 'Starting HTTP server'
- Available Grafana Dasboards does not exists HOT 2
- Docker Build Stuck on "Starting HTTP server" HOT 1
- Can't install Pihole exporter in docker - raspberry pi 4 HOT 3
- pie chart not found HOT 3
- `Enabled` metric doesn't seem to do anything HOT 1
- GO Unknown flag -buildvcs
- Allow specifying the listening interface
- Arm64 release?
- Can't start it when deploying to K8s HOT 1
- Nothing happening on Raspberry Pi HOT 3
- Bad Data HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pihole-exporter.