Skip to content

Using Pi-hole Visualizer for a Quick Look into Your Ad-Blocking Stats

In my opinion Pi-hole is one of the best things you can do with a Raspberry Pi, all you have to do is set it up once and sit back and enjoy ad-free web browsing. One thing I really like about Pi-hole is the Admin pager which is filled with all kinds of graphs, charts and stats for me to sit and geek out over for hours. I have wanted to somehow integrate some quick stats into my Raspberry Pi system without the need to remote in to it and go to the Pi-hole Admin Page. I have thought about adding Raspberry Pi Touchscreen Monitor to it but my Raspberry Pi running Pi-hole it’s in my mechanical room with the rest of my networking and automation gear, so the touchscreen really would have been a bit much. Well last week while scrolling through HACKADAY I came across an interesting article titled Visualizing Blocked Ads With the Pi Sense Hat. I just happened to have a Raspberry Pi Sense Hat kicking around doing nothing, so I figured that would be a good project.

Assuming you already have Pi-hole up and running on your Raspberry Pi setup of the Visualizer is pretty simple and you can reference the GitHub Repository for the project by simianAstronaut. Below I will take you through the setup of the visualizer starting with a Raspberry Pi that is already running Pi-hole.

Raspberry Pi Sense Hat Setup

  1. Connect Sense Hat to Raspberry PI GPIO
  2. From the Raspbian Desktop launch Terminal
  3. From Terminal you need to install the Raspberry Pi Sense Hat using the follow command,
  • sudo apt-get install sense-hat

Downloading the Visualizer Code

  1. From Terminal you can download the Visualizer Code by running the following command,

Setting Up the Visualizer

  1. We need to check the dns_stats.service Unit File to ensure the path to our file is correct. From Terminal run the following command
  • sudo nano /home/pi/pi-hole-visualizer/dns_stats.service
  1. In this file check that the path in line 7 (starts with ExecStart) matches where you saved the files (if you used the exact command listed above this path will be correct.
  2. Type CTRL X
  3. Save the file

Convert the Script to a System Service

  1. Navigate to the folder where the script is saved:
  • cd /home/pi/pi-hole-visualizer
  1. Make the script and unit file executable.
  • sudo chmod +x
  • sudo chmod +x dns_stats.service
  1. Copy the unit file to the system directory
  • sudo cp dns_stats.service /lib/systemd/system
  1. Enable the service to run at startup
  • sudo systemctl enable dns_stats
  1. Reboot using sudo reboot
  2. Check that the service is running with sudo systemctl status dns_stats

That is it you should be up and running. The Pi-hole Visualizer using the Raspberry Pi Sense Hat is pretty simple to set up but it should be noted that is you are on a development branch of Pi-hole it will not work so if you read my blog post about the Pi-hole Beta and decided to join you will have to revert to the master branch if you want to use the Visualizer.

What are your thoughts on this project? Let me know in the comments below.


Mike View All

I am passionate about the IoT and connected devices. Using connectivity to automate our lives will empower civilization to achieve greatness.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: