Monitoring/Pi-Hole/README.md
2023-07-04 13:06:44 +02:00

54 lines
2.0 KiB
Markdown

# Centreon (or Nagios) Plugin for the Pi-Hole API
![picture](https://www.tips-of-mine.fr/wp-content/uploads/2023/04/logo.jpg)
A set of probes to extract a lot of information from a Pi-hole device through its API.
## Installation
- Copy the script in the ***"/usr/lib/centreon/plugin"*** folder
#### Find Pi-Hole token
- Connect to your Pihole equipment
- Get the token with the value ***WEBPASSWORD*** from the file `cat /etc/pihole/setupVars.conf | grep WEBPASSWORD`.
<br />
- Connect to your Centreon or Nagios device
- put it in `/usr/lib/centreon/plugin`.
centreon-engine@centreon # touch pihole-api.token <br />
centreon-engine@centreon # echo 'PASTE_YOUR_TOKEN_HERE' >> pihole-api.token <br />
## Usage
+ Usage `./check_pihole_api -h pihole_ipaddress -e [ads || being || clients || queries ] || -c || -f || -q || -r || -s || -t || -v`
+ ***-h***
ip address or fqdn name of the machine running Pi-Hole
+ ***-c*** (cache)
show cache use
+ ***-e*** (summary)
+ ***ads*** : Number and percentage of ads blocked.
+ ***being*** : Amount of blocked domain.
+ ***clients***: Number of clients using Pihole as their DNS server
+ ***queries***: Number of DNS queries
+ ***-f*** (forwarded)
show forwarded use
+ ***-q*** (querie)
queries by type AAAA, A, SOA, TXT, PTR, ANY, SRV, IPV4, IPV6, MX, DS, RRSIG, DNSKEY, NS, OTHER, SVCB
+ ***-r*** (reply)
queries by reply UNKNOWN, NODATA, NXDOMAIN, CNAME, IP, DOMAIN
+ ***-s*** (status)
show the status service (enable/disable)
+ ***-t*** (top 10)
Show a TOP number of queries by host
+ ***-v*** (information)
show the version of the plugin
## Centreon
![picture](https://www.tips-of-mine.fr/wp-content/uploads/2023/04/2023-04-23-13_53_12-Centreon-IT-Network-Monitoring-—-Mozilla-Firefox.png)
## More info
- more information on the website [Tips-Of-Mine](https://www.tips-of-mine.fr/?p=1837)
## Buy me a coffe
<a href='https://ko-fi.com/R5R2KNI3N' target='_blank'><img height='36' style='border:0px;height:36px;' src='https://storage.ko-fi.com/cdn/kofi4.png?v=3' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a>