diff --git a/definitions/ext-pi_hole/dashboard.json b/definitions/ext-pi_hole/dashboard.json new file mode 100644 index 000000000..4e83cf6aa --- /dev/null +++ b/definitions/ext-pi_hole/dashboard.json @@ -0,0 +1,163 @@ +{ + "dashboard": { + "title": "PiHole", + "widgets": [ + { + "title": "Total DNS requests", + "nrql": "FROM Metric SELECT latest(pihole_dns_queries_today) as 'Total DNS requests'", + "process_as": "billboard", + "width": 3, + "height": 2, + "row": 1, + "column": 1, + "event_types": null, + "facet": null, + "customizations": { "thresholds": {} }, + "notes": null + }, + { + "title": "Blocked DNS requests", + "nrql": "FROM Metric SELECT latest(pihole_ads_blocked_today) as 'Blocked DNS requests'", + "process_as": "billboard", + "width": 3, + "height": 2, + "row": 1, + "column": 4, + "event_types": null, + "facet": null, + "customizations": { "thresholds": {} }, + "notes": null + }, + { + "title": "% blocked requests", + "nrql": "FROM Metric SELECT latest(pihole_ads_percentage_today) as '% blocked requests'", + "process_as": "billboard", + "width": 3, + "height": 2, + "row": 1, + "column": 7, + "event_types": null, + "facet": null, + "customizations": { "thresholds": {} }, + "notes": null + }, + { + "title": "Domains on blocklist", + "nrql": "FROM Metric SELECT latest(pihole_domains_being_blocked) as 'Domains on blocklist'", + "process_as": "billboard", + "width": 3, + "height": 2, + "row": 1, + "column": 10, + "event_types": null, + "facet": null, + "customizations": { "thresholds": {} }, + "notes": null + }, + { + "title": "DNS requests", + "nrql": "FROM Metric SELECT ifthen( (earliest(pihole_dns_queries_today) - latest(pihole_dns_queries_today)) <= 0 , latest(pihole_dns_queries_today) - earliest(pihole_dns_queries_today) ) as 'DNS requests' timeseries", + "process_as": "line_chart", + "width": 3, + "height": 3, + "row": 3, + "column": 1, + "event_types": null, + "facet": null, + "customizations": { "thresholds": {} }, + "notes": null + }, + { + "title": "Requests blocked", + "nrql": "FROM Metric SELECT ifthen( (earliest(pihole_ads_blocked_today) - latest(pihole_ads_blocked_today)) <= 0 , latest(pihole_ads_blocked_today) - earliest(pihole_ads_blocked_today) ) as 'Requests blocked' timeseries", + "process_as": "line_chart", + "width": 3, + "height": 3, + "row": 3, + "column": 4, + "event_types": null, + "facet": null, + "customizations": { "thresholds": {} }, + "notes": null + }, + { + "title": "Requests forwarded", + "nrql": "FROM Metric SELECT ifthen( (earliest(pihole_queries_forwarded) - latest(pihole_queries_forwarded)) <= 0 , latest(pihole_queries_forwarded) - earliest(pihole_queries_forwarded) ) as 'Requests forwarded' timeseries", + "process_as": "line_chart", + "width": 3, + "height": 3, + "row": 3, + "column": 7, + "event_types": null, + "facet": null, + "customizations": { "thresholds": {} }, + "notes": null + }, + { + "title": "Requests cached", + "nrql": "FROM Metric SELECT ifthen( (earliest(pihole_queries_cached) - latest(pihole_queries_cached)) <= 0 , latest(pihole_queries_cached) - earliest(pihole_queries_cached) ) as 'Requests cached' timeseries", + "process_as": "line_chart", + "width": 3, + "height": 3, + "row": 3, + "column": 10, + "event_types": null, + "facet": null, + "customizations": { "thresholds": {} }, + "notes": null + }, + { + "title": "Cumulative DNS requests", + "nrql": "FROM Metric SELECT latest(pihole_dns_queries_today) as 'Cumulative DNS requests' TIMESERIES", + "process_as": "line_chart", + "width": 3, + "height": 3, + "row": 6, + "column": 1, + "event_types": null, + "facet": null, + "customizations": null, + "notes": null + }, + { + "title": "Cumulative requests blocked", + "nrql": "FROM Metric SELECT latest(pihole_ads_blocked_today) as 'Cumulative requests blocked' TIMESERIES", + "process_as": "line_chart", + "width": 3, + "height": 3, + "row": 6, + "column": 4, + "event_types": null, + "facet": null, + "customizations": null, + "notes": null + }, + { + "title": "Cumulative requests forwarded", + "nrql": "FROM Metric SELECT latest(pihole_queries_forwarded) as 'Cumulative requests forwarded' TIMESERIES", + "process_as": "line_chart", + "width": 3, + "height": 3, + "row": 6, + "column": 7, + "event_types": null, + "facet": null, + "customizations": null, + "notes": null + }, + { + "title": "Cumulative requests cached", + "nrql": "FROM Metric SELECT latest(pihole_queries_cached) as 'Cumulative requests cached' TIMESERIES", + "process_as": "line_chart", + "width": 3, + "height": 3, + "row": 6, + "column": 10, + "event_types": null, + "facet": null, + "customizations": null, + "notes": null + } + ] + } +} diff --git a/definitions/ext-pi_hole/definition.yml b/definitions/ext-pi_hole/definition.yml new file mode 100644 index 000000000..c677d377b --- /dev/null +++ b/definitions/ext-pi_hole/definition.yml @@ -0,0 +1,22 @@ +domain: EXT +type: PIHOLE + +synthesis: + name: piHoleName + identifier: piHoleName + + conditions: + - attribute: metricName + prefix: pihole_ +dashboardTemplates: + - dashboard.json + +compositeMetrics: + goldenMetrics: + - golden_metrics.yml + summaryMetrics: + - summary_metrics.yml + +configuration: + entityExpirationTime: EIGHT_DAYS + alertable: true diff --git a/definitions/ext-pi_hole/golden_metrics.yml b/definitions/ext-pi_hole/golden_metrics.yml new file mode 100644 index 000000000..ec2e20a3e --- /dev/null +++ b/definitions/ext-pi_hole/golden_metrics.yml @@ -0,0 +1,8 @@ +totalQueries: + title: Total queries + query: + select: latest(pi_hole_dns_queries_all_types) +adsBlockedToday: + title: Ads Blocked Today + query: + select: latest(pi_hole_ads_blocked_today) diff --git a/definitions/ext-pi_hole/summary_metrics.yml b/definitions/ext-pi_hole/summary_metrics.yml new file mode 100644 index 000000000..ac5ab6ec5 --- /dev/null +++ b/definitions/ext-pi_hole/summary_metrics.yml @@ -0,0 +1,14 @@ +totalQueries: + title: Total queries + unit: COUNT + query: + select: latest(pi_hole_dns_queries_all_types) + from: Metric + eventId: entity.guid +adsBlockedToday: + title: Ads Blocked Today + unit: COUNT + query: + select: latest(pi_hole_ads_blocked_today) + from: Metric + eventId: entity.guid