Add sqlite3 reporting to pihole and web inteface

Fully operational, simply wondering if this would be a welcome addition to pihole?
Feature request triggered by this github issue.

a report (auto generated) look like this (examples)


  • very little change to (simply execute an additional script - last line of gravity).
  • additional script to calculate the diff (gravity.db / gravity_old.db), executed by, results are stored in the old gravity database.
  • additional script (100 lines) to generate the reports, json (holds all queries and info to generate the reports), sqlite3 db (static, never changes, to display text for values - see third screenshot).
  • cron job to execute the report script.
  • add some lighttpd directives to show the reporting folder (see first sceenshot) and add mime type.
  • requires binaries jq (already part of pihole) and 'wkhtmltopdf' (in the raspbian repository) to print the pdf.
  • additional entry in the web interface menu.

I think this would be a bit too much. Remember we need to maintain all this throughout every change we made.
Regarding the posted issue: I would be OK with gravity reporting number of added/deleted domains at the end of the run (although personally, I don't see much gain in this), but not with a list of added/removed domains.

gravity only calculates the diff, stores the results in the old database, it displays (gif has been edited, script runs longer, depending on the database size):


the report script generates reports, totally independent of gravity, it just needs the diff results to generate the reports, the reports are limited to 100 domains, the 'More info' link in the report would point to the pihole docs, explaining how to get a list of all domains.

In my opinion, this should be a user developed and maintained project separate from Pi-hole. If anybody is interested, they can download the code from your site.