5.02021-11-21T22:00:35ZTemplatesApp Pi-HoleApp Pi-Hole## Description
Domains Blocked DNS Queries Today Ads Blocked Today Ads Blocked Percentage Today Clients Ever Seen Unique Clients Reply NODATA Reply NXDOMAIN Reply CNAME Reply IP
## Overview
**Pi-Hole API**
**Auth integration:**
Simply execute this command on Pi-Hole to retrieve API Token:
```
sudo cat /etc/pihole/setupVars.conf | grep PASSWORD | cut -d "=" -f2
```
Or go in the Pi-Hole WebUI > Settings > tab Api / Web Interface > button Show API Token.
Report the value in Zabbix:
Configuration > Hosts > [your Pi-Hole] > Macros Tab > new macro:
* Macro: {$WEBPASSWORD}
* Value: [the result of the command executed on your Pi-Hole]
**Changelog:**
*****Update 2022.26.12 (v1.4):****- added Auth support for summaryRaw:
- added auth support to summaryRaw (https://pi-hole.net/blog/2022/11/17/upcoming-changes-authentication-for-more-api-endpoints-required/)
****Update 2020.8.3 (v1.4):****- added getQueryTypes dependent items + graph:
* MX
* DS
* RRSIG
* DNSKEY
* OTHER
******Update 2020.7.9 (v1.3):******- added Auth support
****Update 2020.7.8 (v1.2):****- bugfixes in existing items (preprocessing stuff)
- switch to "summaryRaw" URL (http://{HOST.IP}/admin/api.php?summaryRaw)
- link this page to Pi-Hole API FAQ
- template graphics
- new API metrics: http://{HOST.IP}/admin/api.php?getQueryTypes
getQueryTypes dependent items:
* A (IPv4)
* AAAA (IPv6)
* ANY
* NAPTR
* PTR
* SOA
* SRV
* TXT
**Initiale release (v1.1):**
API SummaryRaw (no auth needed): http://{HOST.IP}/admin/api.php?summaryRaw
API Dependent items:
* Ads blocked today
* Ads percentage today
* DNS queries all types
* DNS queries today
* Domains being blocked
* Queries cached
* Queries forwarded
* Reply CNAME
* Reply IP
* Reply NODATA
* Reply NXDOMAIN
* Clients ever seen
* Unique clients
* Unique domain
## Author
Undefined_ID
TemplatesDNS- API_SummaryRawHTTP_AGENTjson.pihole0TEXTDNShttp://{HOST.IP}/admin/api.phpsummaryRawauth{$WEBPASSWORD}
- Ads blocked todayDEPENDENTjson.pihole.ads_blocked_today0DNSJSONPATH$.ads_blocked_todaySIMPLE_CHANGEjson.pihole
- Ads percentage todayDEPENDENTjson.pihole.ads_percentage_today0FLOATDNSJSONPATH$.ads_percentage_todayjson.pihole
- Clients ever seenDEPENDENTjson.pihole.clients_ever_seen0DNSJSONPATH$.clients_ever_seenjson.pihole
- DNS queries all typesDEPENDENTjson.pihole.dns_queries_all_types0DNSJSONPATH$.dns_queries_all_typesSIMPLE_CHANGEjson.pihole
- DNS queries todayDEPENDENTjson.pihole.dns_queries_today0DNSJSONPATH$.dns_queries_todaySIMPLE_CHANGEjson.pihole
- Domains being blockedDEPENDENTjson.pihole.domains_being_blocked0!DNSJSONPATH$.domains_being_blockedjson.pihole
- Queries cachedDEPENDENTjson.pihole.queries_cached0DNSJSONPATH$.queries_cachedSIMPLE_CHANGEjson.pihole
- Queries forwardedDEPENDENTjson.pihole.queries_forwarded0DNSJSONPATH$.queries_forwardedSIMPLE_CHANGEjson.pihole
- API_getQueryTypesHTTP_AGENTjson.pihole.querytypes0TEXTDNShttp://{HOST.IP}/admin/api.phpgetQueryTypesauth{$WEBPASSWORD}
- A (IPv4)DEPENDENTjson.pihole.querytypes.a0FLOAT!DNSJSONPATH$['querytypes']['A (IPv4)']SIMPLE_CHANGEjson.pihole.querytypes
- AAAA (IPv6)DEPENDENTjson.pihole.querytypes.aaaa0FLOAT!DNSJSONPATH$['querytypes']['AAAA (IPv6)']SIMPLE_CHANGEjson.pihole.querytypes
- ANYDEPENDENTjson.pihole.querytypes.any0FLOAT!DNSJSONPATH$['querytypes']['ANY']SIMPLE_CHANGEjson.pihole.querytypes
- DNSKEYDEPENDENTjson.pihole.querytypes.dnskey0!DNSJSONPATH$['querytypes']['DNSKEY']SIMPLE_CHANGEjson.pihole.querytypes
- DSDEPENDENTjson.pihole.querytypes.ds0!DNSJSONPATH$['querytypes']['DS']SIMPLE_CHANGEjson.pihole.querytypes
- MXDEPENDENTjson.pihole.querytypes.mx0!DNSJSONPATH$['querytypes']['MX']SIMPLE_CHANGEjson.pihole.querytypes
- NAPTRDEPENDENTjson.pihole.querytypes.naptr0FLOAT!DNSJSONPATH$['querytypes']['NAPTR']SIMPLE_CHANGEjson.pihole.querytypes
- OTHERDEPENDENTjson.pihole.querytypes.other0!DNSJSONPATH$['querytypes']['OTHER']SIMPLE_CHANGEjson.pihole.querytypes
- PTRDEPENDENTjson.pihole.querytypes.ptr0FLOAT!DNSJSONPATH$['querytypes']['PTR']SIMPLE_CHANGEjson.pihole.querytypes
- RRSIGDEPENDENTjson.pihole.querytypes.rrsig0!DNSJSONPATH$['querytypes']['RRSIG']SIMPLE_CHANGEjson.pihole.querytypes
- SOADEPENDENTjson.pihole.querytypes.soa0FLOAT!DNSJSONPATH$['querytypes']['SOA']SIMPLE_CHANGEjson.pihole.querytypes
- SRVDEPENDENTjson.pihole.querytypes.srv0FLOAT!DNSJSONPATH$['querytypes']['SRV']SIMPLE_CHANGEjson.pihole.querytypes
- TXTDEPENDENTjson.pihole.querytypes.txt0FLOAT!DNSJSONPATH$['querytypes']['TXT']SIMPLE_CHANGEjson.pihole.querytypes
- Reply CNAMEDEPENDENTjson.pihole.reply_CNAME0DNSJSONPATH$.reply_CNAMESIMPLE_CHANGEjson.pihole
- Reply IPDEPENDENTjson.pihole.reply_IP0DNSJSONPATH$.reply_IPSIMPLE_CHANGEjson.pihole
- Reply NODATADEPENDENTjson.pihole.reply_NODATA0DNSJSONPATH$.reply_NODATASIMPLE_CHANGEjson.pihole
- Reply NXDOMAINDEPENDENTjson.pihole.reply_NXDOMAIN0DNSJSONPATH$.reply_NXDOMAINSIMPLE_CHANGEjson.pihole
- Unique clientsDEPENDENTjson.pihole.unique_clients0DNSJSONPATH$.unique_clientsjson.pihole
- Unique domainsDEPENDENTjson.pihole.unique_domains0DNSJSONPATH$.unique_domainsSIMPLE_CHANGEjson.pihole
Ads percentage todayFIXEDF63100RIGHT- App Pi-Holejson.pihole.ads_percentage_today
100BFFF- App Pi-Holejson.pihole.domains_being_blocked
ClientsFIXED199C0D- App Pi-Holejson.pihole.clients_ever_seen
1F63100- App Pi-Holejson.pihole.unique_clients
DNS queriesSTACKEDFFFFFF- App Pi-Holejson.pihole.dns_queries_today
100FF00- App Pi-Holejson.pihole.queries_cached
29C27B0- App Pi-Holejson.pihole.queries_forwarded
3FC6EA3- App Pi-Holejson.pihole.unique_domains
DNS repliesSTACKED199C0D- App Pi-Holejson.pihole.reply_CNAME
1F63100- App Pi-Holejson.pihole.reply_IP
22774A4- App Pi-Holejson.pihole.reply_NODATA
3F7941D- App Pi-Holejson.pihole.reply_NXDOMAIN
Query TypesSTACKED199C0D- App Pi-Holejson.pihole.querytypes.a
1F63100- App Pi-Holejson.pihole.querytypes.aaaa
22774A4- App Pi-Holejson.pihole.querytypes.any
3C7A72D- App Pi-Holejson.pihole.querytypes.srv
46C59DC- App Pi-Holejson.pihole.querytypes.soa
5FC6EA3- App Pi-Holejson.pihole.querytypes.ptr
6BA2A5D- App Pi-Holejson.pihole.querytypes.txt
7F7941D- App Pi-Holejson.pihole.querytypes.naptr
8F230E0- App Pi-Holejson.pihole.querytypes.mx
95CCD18- App Pi-Holejson.pihole.querytypes.ds
10BB2A02- App Pi-Holejson.pihole.querytypes.rrsig
11AC41A5- App Pi-Holejson.pihole.querytypes.dnskey
1289ABF8- App Pi-Holejson.pihole.querytypes.other