leiweibau / Pi.Alert

Scan the devices connected to your WIFI / LAN and alert you the connection of unknown devices. It also warns if a "always connected" device disconnects. In addition, it is possible to check web services for availability. For this purpose HTTP status codes and the response time of the service are evaluated.
https://leiweibau.net
GNU General Public License v3.0
406 stars 28 forks source link

Use pihole API rather than reading the db directly #183

Closed danielo515 closed 11 months ago

danielo515 commented 11 months ago

Hello, and thanks for keeping this fork. I have my pihole setup in a specific container, and it is not in the same machine as pialert. Reading the config, I guess this is expected to have the pihole database shared as a volume or something? Will it be possible to instead use the API? thanks in advance

leiweibau commented 11 months ago

Hello,

when it comes to such concrete technical proposals, I would be happy to receive links/information to get into the topic as well.

As far as I can see, the API is not suitable for obtaining the information needed. https://github.com/pi-hole/AdminLTE/blob/master/api.php https://github.com/pi-hole/AdminLTE/blob/master/api_FTL.php

As a workaround I could imagine to make a readonly SMB share of the database and mount this share on the Pi.Alert host. In the configuration file the path to this mounted share could be set.

danielo515 commented 11 months ago

That is a fair take. Even a simple NFS will probably do. Thanks for considering it. Some nice thing to add to the docs (I couldn't find it) is the DB access requirement

leiweibau commented 11 months ago

Will keep this in mind when working on the doc on a regular basis.