Push notifications triggered by failure states

I really don't know when this has changed, and unfortunately, it's undocumented, but it's possible this (failed requests) could be detected, using a simple SQL query on the gravity database / adlist table. There is a field, status, that might indicate a failed download (not sure).

To test this, I've added a list (entry for a non existing file - https://ligatus.com/blocklist.txt) and ran pihole -g.
The status field value for this list is 4, the message on screen (when running pihole -g) is List download failed: no cached list available

I use several scripts and cron jobs to query the databases, running these when it suits my needs. The result, if alarming, is mailed to me, so I know it's happening, and I can take the appropriate action, if needed.

There are several events I wish to be notified about, the information is almost always available in the databases, the missing thing is a script (SQL query) to detect the event and a cron job to report the event on an appropriate time.

In order to increase the detectable events, I recently submitted a feature request to keep the old database available, I've already wrote the code and submitted it for review to DL6ER
I'm currently running this modified gravity.sh and query.sh, it allows me, among other things, to get a list of domains that have been blocked for the first time, since the latest gravity run, which makes troubleshooting unexpected blocks a lot easier.

I admit this is a workaround, you need to write the scripts, schedule the cron jobs (OR execute the scripts for an immediate eval), but it is an improvement over not knowing things are going wrong, like you indicated.

edit
looking at the code in gravity.sh, there are 5 status codes
0: list has been added, gravity hasn't run yet, thus no status
1: No checksum available, create one for comparing on the next run
2: The list changed upstream, we need to update the checksum
3: List download failed: using previously cached list
4: List download failed: no cached list available
/edit

edit2
looks like there is a little bug? / problem? in gravity:
created two, non existing list entries (htttps://ligatus.com/test.txt and http://localhost/test.txt)
The first status (htttps://ligatus.com/test.txt) is correct (4),
however,
http://localhost/test.txt reports status 1, even though the file does not exist (the default webserver page (Did you mean to go to the admin panel?) is downloaded and evaluated instead).

This implies failures for files, served from the local machine, using url cannot be detected. Workaround is to use the syntax file:///var/www/html/test.txt.


/edit2