Open aSilentSniper opened 1 year ago
Hi @aSilentSniper, Thanks for mentioning my issue. I'll try your patch the next few days.
I've tried your patched version. Works like a charm. Thanks!
When pasting an empty, or wrong token, the check script crashes:
Traceback (most recent call last):
File "/usr/local/bin/check_pihole.py", line 77, in <module>
main()
File "/usr/local/bin/check_pihole.py", line 64, in main
if url_output["status"] != "enabled":
TypeError: list indices must be integers or slices, not str
Unfortunately, the Pihole API answers with a HTTP status code 200. So there's only checking for an empty result I think. Having my patch applied, the output is:
UNKNOWN: Empty result from Pihole. Wrong API token?
Maybe you wanna add this patch in this PR. check_pihole.py.patch
(Apologies if this is not the best method for sharing the patch.)
@wopfel Thanks for your Patch it is working and i added it to this PR
I added the needed token to the script