The pihole team has already done a great job, creating (and expanding) the pihole debug log (pihole -d).
The pihole team is also very consistent in requesting a pihole debug log, to help them solve various problems.
It needs to be said a lot of users, asking help, never looked at the output of the debug log for various reasons, one of the reasons being it contains a lot of information, sometimes to complicated to understand for the average user.
Pi-hole already has a mecanism on board to report problems (the message table in the pihole-FTL database), which in turn shows a warning sign, if something has been detected.
Folowing suggestion:
- add a button to the pihole diagnosis screen, that makes pihole-d run.
- add logic to the debug script to generate messages. Examples:
This topic describes a timesync problem. By running (in the debug script) timedatectl, grep for "System clock synchronized: yes", you could add a message to the message table.
This topic describes a method to generate an open resolver message
Any other debug log test, that triggers an obvious configuration error...
- optionally, add the following to /home/pi/.bashrc:
count=$(sqlite3 "/etc/pihole/pihole-FTL.db" "SELECT count(*) FROM message")
if [ "${count}" -ne "0" ];then
echo
echo "Active pihole diagnostic messages found!"
echo "Check Tools / Pi-hole diagnosis"
echo
fi