zabbix_export: version: '6.0' date: '2022-04-21T13:17:42Z' groups: - uuid: 7df96b18c230490a9a0a9e2307226338 name: Templates templates: - uuid: bce5d89fe8884d398946275b4bde2e5a template: 'App Pi-Hole' name: 'App Pi-Hole' description: | ## 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 groups: - name: Templates items: - uuid: 5abdf4a0bcea4347842dd42f4392e20d name: API_SummaryRaw type: HTTP_AGENT key: json.pihole trends: '0' value_type: TEXT url: 'http://{HOST.IP}/admin/api.php' query_fields: - name: summaryRaw - name: auth value: '{$WEBPASSWORD}' tags: - tag: Application value: DNS - uuid: 9b30ab5834ec49f984b62e27511da57c name: 'Ads blocked today' type: DEPENDENT key: json.pihole.ads_blocked_today delay: '0' preprocessing: - type: JSONPATH parameters: - $.ads_blocked_today master_item: key: json.pihole tags: - tag: Application value: DNS - uuid: 0c0c213e34eb45f795e042540079638e name: 'Ads percentage today' type: DEPENDENT key: json.pihole.ads_percentage_today delay: '0' value_type: FLOAT preprocessing: - type: JSONPATH parameters: - $.ads_percentage_today master_item: key: json.pihole tags: - tag: Application value: DNS - uuid: df54f0a08c2a401ead6fa7e233f40f54 name: 'Clients ever seen' type: DEPENDENT key: json.pihole.clients_ever_seen delay: '0' preprocessing: - type: JSONPATH parameters: - $.clients_ever_seen master_item: key: json.pihole tags: - tag: Application value: DNS - uuid: 01f8b3d6b4e5410591b8edc019211add name: 'DNS queries all types' type: DEPENDENT key: json.pihole.dns_queries_all_types delay: '0' preprocessing: - type: JSONPATH parameters: - $.dns_queries_all_types master_item: key: json.pihole tags: - tag: Application value: DNS - uuid: 00d259fbd47943d5998838798c642b4e name: 'DNS queries today' type: DEPENDENT key: json.pihole.dns_queries_today delay: '0' preprocessing: - type: JSONPATH parameters: - $.dns_queries_today master_item: key: json.pihole tags: - tag: Application value: DNS - uuid: 7015b7561c9848178ba9e432a1da8f42 name: 'Domains being blocked' type: DEPENDENT key: json.pihole.domains_being_blocked delay: '0' units: '!' preprocessing: - type: JSONPATH parameters: - $.domains_being_blocked master_item: key: json.pihole tags: - tag: Application value: DNS - uuid: 8f01117e7dd8452cb89202ba74eed1a2 name: 'Queries cached' type: DEPENDENT key: json.pihole.queries_cached delay: '0' preprocessing: - type: JSONPATH parameters: - $.queries_cached master_item: key: json.pihole tags: - tag: Application value: DNS - uuid: da6c95f3cd6f4ff0973e4bb8ddcfb0c0 name: 'Queries forwarded' type: DEPENDENT key: json.pihole.queries_forwarded delay: '0' preprocessing: - type: JSONPATH parameters: - $.queries_forwarded master_item: key: json.pihole tags: - tag: Application value: DNS - uuid: 9699c027c8c240adbcbfb81a4bdd393d name: API_getQueryTypes type: HTTP_AGENT key: json.pihole.querytypes trends: '0' value_type: TEXT url: 'http://{HOST.IP}/admin/api.php' query_fields: - name: getQueryTypes - name: auth value: '{$WEBPASSWORD}' tags: - tag: Application value: DNS - uuid: fb783570c62f4b80924aeed26a9860d7 name: 'A (IPv4)' type: DEPENDENT key: json.pihole.querytypes.a delay: '0' value_type: FLOAT units: '!' preprocessing: - type: JSONPATH parameters: - '$[''querytypes''][''A (IPv4)'']' master_item: key: json.pihole.querytypes tags: - tag: Application value: DNS - uuid: 1bf3c8a506154980bf31a65478e895a6 name: 'AAAA (IPv6)' type: DEPENDENT key: json.pihole.querytypes.aaaa delay: '0' value_type: FLOAT units: '!' preprocessing: - type: JSONPATH parameters: - '$[''querytypes''][''AAAA (IPv6)'']' master_item: key: json.pihole.querytypes tags: - tag: Application value: DNS - uuid: 93ce14ced4004e769fddd488e8023726 name: ANY type: DEPENDENT key: json.pihole.querytypes.any delay: '0' value_type: FLOAT units: '!' preprocessing: - type: JSONPATH parameters: - '$[''querytypes''][''ANY'']' master_item: key: json.pihole.querytypes tags: - tag: Application value: DNS - uuid: d04556293699455ca9dde222129bc8e8 name: DNSKEY type: DEPENDENT key: json.pihole.querytypes.dnskey delay: '0' value_type: FLOAT units: '!' preprocessing: - type: JSONPATH parameters: - '$[''querytypes''][''DNSKEY'']' master_item: key: json.pihole.querytypes tags: - tag: Application value: DNS - uuid: fe5d59ad0ec7411081a151d7f4f3bd7c name: DS type: DEPENDENT key: json.pihole.querytypes.ds delay: '0' value_type: FLOAT units: '!' preprocessing: - type: JSONPATH parameters: - '$[''querytypes''][''DS'']' master_item: key: json.pihole.querytypes tags: - tag: Application value: DNS - uuid: d3423e129bbd4a4f9521287feeded5b5 name: MX type: DEPENDENT key: json.pihole.querytypes.mx delay: '0' value_type: FLOAT units: '!' preprocessing: - type: JSONPATH parameters: - '$[''querytypes''][''MX'']' master_item: key: json.pihole.querytypes tags: - tag: Application value: DNS - uuid: ba5b93109c914dc98714e36fe2919af2 name: NAPTR type: DEPENDENT key: json.pihole.querytypes.naptr delay: '0' value_type: FLOAT units: '!' preprocessing: - type: JSONPATH parameters: - '$[''querytypes''][''NAPTR'']' master_item: key: json.pihole.querytypes tags: - tag: Application value: DNS - uuid: 5afed63bfc2f4269a0b14527b959208f name: OTHER type: DEPENDENT key: json.pihole.querytypes.other delay: '0' units: '!' preprocessing: - type: JSONPATH parameters: - '$[''querytypes''][''OTHER'']' master_item: key: json.pihole.querytypes tags: - tag: Application value: DNS - uuid: e6952de0e98148f2bf84a17999cce9b4 name: PTR type: DEPENDENT key: json.pihole.querytypes.ptr delay: '0' value_type: FLOAT units: '!' preprocessing: - type: JSONPATH parameters: - '$[''querytypes''][''PTR'']' master_item: key: json.pihole.querytypes tags: - tag: Application value: DNS - uuid: 892de025ed9e4c00a9393ccd38c8d167 name: RRSIG type: DEPENDENT key: json.pihole.querytypes.rrsig delay: '0' value_type: FLOAT units: '!' preprocessing: - type: JSONPATH parameters: - '$[''querytypes''][''RRSIG'']' master_item: key: json.pihole.querytypes tags: - tag: Application value: DNS - uuid: f23fe02def0d42798913e747c18e76f5 name: SOA type: DEPENDENT key: json.pihole.querytypes.soa delay: '0' value_type: FLOAT units: '!' preprocessing: - type: JSONPATH parameters: - '$[''querytypes''][''SOA'']' master_item: key: json.pihole.querytypes tags: - tag: Application value: DNS - uuid: 30dc2bb793a74631bc8f53e272336e90 name: SRV type: DEPENDENT key: json.pihole.querytypes.srv delay: '0' value_type: FLOAT units: '!' preprocessing: - type: JSONPATH parameters: - '$[''querytypes''][''SRV'']' master_item: key: json.pihole.querytypes tags: - tag: Application value: DNS - uuid: bc747ba992dd404f9ca739622be162f2 name: TXT type: DEPENDENT key: json.pihole.querytypes.txt delay: '0' value_type: FLOAT units: '!' preprocessing: - type: JSONPATH parameters: - '$[''querytypes''][''TXT'']' master_item: key: json.pihole.querytypes tags: - tag: Application value: DNS - uuid: f12631912261453dbbe82bd129b16f8d name: 'Reply CNAME' type: DEPENDENT key: json.pihole.reply_CNAME delay: '0' preprocessing: - type: JSONPATH parameters: - $.reply_CNAME master_item: key: json.pihole tags: - tag: Application value: DNS - uuid: 14632c2d9c2c41d48a6b50f0fb21fb70 name: 'Reply IP' type: DEPENDENT key: json.pihole.reply_IP delay: '0' preprocessing: - type: JSONPATH parameters: - $.reply_IP master_item: key: json.pihole tags: - tag: Application value: DNS - uuid: 5be7e08272d64ca0bb0d46012248250c name: 'Reply NODATA' type: DEPENDENT key: json.pihole.reply_NODATA delay: '0' preprocessing: - type: JSONPATH parameters: - $.reply_NODATA master_item: key: json.pihole tags: - tag: Application value: DNS - uuid: 0f0cc1f19d5341cbae4b9f392975269f name: 'Reply NXDOMAIN' type: DEPENDENT key: json.pihole.reply_NXDOMAIN delay: '0' preprocessing: - type: JSONPATH parameters: - $.reply_NXDOMAIN master_item: key: json.pihole tags: - tag: Application value: DNS - uuid: d9d9801793f74e0da5d8301d315b4b06 name: 'Unique clients' type: DEPENDENT key: json.pihole.unique_clients delay: '0' preprocessing: - type: JSONPATH parameters: - $.unique_clients master_item: key: json.pihole tags: - tag: Application value: DNS - uuid: d8c2e85180b340d79fc296bbd79a154a name: 'Unique domains' type: DEPENDENT key: json.pihole.unique_domains delay: '0' preprocessing: - type: JSONPATH parameters: - $.unique_domains master_item: key: json.pihole tags: - tag: Application value: DNS graphs: - uuid: f74d491b474d49bcb9faa24a804be6d9 name: 'Ads percentage today' type: STACKED graph_items: - color: F63100 item: host: 'App Pi-Hole' key: json.pihole.ads_percentage_today - sortorder: '1' color: 00BFFF item: host: 'App Pi-Hole' key: json.pihole.domains_being_blocked - uuid: 21b72525219a4c9885a8438bb17b4a53 name: Clients type: STACKED graph_items: - color: 199C0D item: host: 'App Pi-Hole' key: json.pihole.clients_ever_seen - sortorder: '1' color: F63100 item: host: 'App Pi-Hole' key: json.pihole.unique_clients - uuid: 78b450f0b65b46b596f780f16c0ee1bf name: 'DNS Queries' type: STACKED graph_items: - color: FFFFFF item: host: 'App Pi-Hole' key: json.pihole.dns_queries_today - sortorder: '1' color: 00FF00 item: host: 'App Pi-Hole' key: json.pihole.queries_cached - sortorder: '2' color: 9C27B0 item: host: 'App Pi-Hole' key: json.pihole.queries_forwarded - sortorder: '3' color: FC6EA3 item: host: 'App Pi-Hole' key: json.pihole.unique_domains - uuid: 493567a5e4744805b1bea8e25938c981 name: 'DNS Replies' type: STACKED graph_items: - color: 199C0D item: host: 'App Pi-Hole' key: json.pihole.reply_CNAME - sortorder: '1' color: F63100 item: host: 'App Pi-Hole' key: json.pihole.reply_IP - sortorder: '2' color: 2774A4 item: host: 'App Pi-Hole' key: json.pihole.reply_NODATA - sortorder: '3' color: F7941D item: host: 'App Pi-Hole' key: json.pihole.reply_NXDOMAIN - uuid: 1444c879e703464e85ab794ea1f13ca9 name: 'Query Types' type: STACKED graph_items: - color: 199C0D item: host: 'App Pi-Hole' key: json.pihole.querytypes.a - sortorder: '1' color: F63100 item: host: 'App Pi-Hole' key: json.pihole.querytypes.aaaa - sortorder: '2' color: 2774A4 item: host: 'App Pi-Hole' key: json.pihole.querytypes.any - sortorder: '3' color: F7941D item: host: 'App Pi-Hole' key: json.pihole.querytypes.dnskey - sortorder: '4' color: FC6EA3 item: host: 'App Pi-Hole' key: json.pihole.querytypes.ds - sortorder: '5' color: 6C59DC item: host: 'App Pi-Hole' key: json.pihole.querytypes.mx - sortorder: '6' color: C7A72D item: host: 'App Pi-Hole' key: json.pihole.querytypes.naptr - sortorder: '7' color: BA2A5D item: host: 'App Pi-Hole' key: json.pihole.querytypes.other - sortorder: '8' color: F230E0 item: host: 'App Pi-Hole' key: json.pihole.querytypes.ptr - sortorder: '9' color: 5CCD18 item: host: 'App Pi-Hole' key: json.pihole.querytypes.rrsig - sortorder: '10' color: BB2A02 item: host: 'App Pi-Hole' key: json.pihole.querytypes.soa - sortorder: '11' color: AC41A5 item: host: 'App Pi-Hole' key: json.pihole.querytypes.srv - sortorder: '12' color: 89ABF8 item: host: 'App Pi-Hole' key: json.pihole.querytypes.txt