Monitor Pi-Hole Remotely with PADD in a Terminal

šŸ“… January 22, 2024
Curious to see what Pi-Hole is doing?

Sure, we can use the FTL web-based GUI in a browser, but perhaps you are limited to a terminal interface or maybe you are Mr. Ubergeek who desires a terminal that autoloads in a terminal on your desktop at system startup. Or maybe you just want options.

This is completely possible!

Let’s create a script that displays two terminals at preset locations on the desktop where one terminal shows Pi-Hole statistics using PADD and the other shows the Pi-Hole host system information using bpytop.

Installing PADD

PADD must be installed on your Pi-Hole host. This was performed remotely by SSHing into the Pi-Hole system. If you have an RSA key pair already set up, then you can log into the Pi-Hole host without entering a password. In fact, you will eventually want to do this so the terminals will automatically connect to the remote Pi-Hole system without prompting for a password. This is far more convenient and faster.

Once logged into Pi-Hole, create a directory named padd in your user’s home and cd into it. PADD is a bash script that we must download, and we will put it here. (It can be placed anywhere, but this is good enough for this experiment.)

Download padd.sh

Run this command in the padd directory just created:

wget -N https://raw.githubusercontent.com/jpmck/PADD/master/padd.sh

Set Executable Permissions

chmod +x padd.sh

Testing PADD

That is all! Test padd.sh by running,

./padd.sh

PADD running in a terminal to show current Pi-Hole statistics at a glance. If you see this, then PADD is working properly.

Keep in mind that PADD must be installed on the Pi-Hole system, not the local system from which you are connected via SSH.

Scripting

A script on the local system can auto load both terminals.

#!/bin/bash

gnome-terminal --hide-menubar --geometry 80x24+1100+50 -- ssh 192.168.37.88 -t ~/padd/padd.sh
gnome-terminal --hide-menubar --geometry 80x24+1100+514 -- ssh 192.168.37.88 -t bpytop

Two terminals are created. One shows PADD, and the other shows bpytop.

Top terminal shows PADD Pi-Hole statistics, and the bottom terminal shows bpytop from the same host.

gnome-terminal must be present on the local system to open the terminals. The geometry option positions the terminals on the desktop. Trial and error determines the exact locations. The terminal menubars are hidden using the hide-menubar option.

A script like this can autorun upon logging in or manually to quickly check the status of Pi-Hole and the host on which it is running. We could add a third terminal that tails pihole activity using pihole -t, but this requires that we enter the sudo password for the Pi-Hole host. PADD does not require sudo, making this more automatic.

Have fun!

, ,

  1. Leave a comment

Leave a comment