Skip to content

Commit

Permalink
Create a new pihole entity definition (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
flisflis authored Mar 2, 2021
1 parent 729dd36 commit 5a182a7
Show file tree
Hide file tree
Showing 4 changed files with 207 additions and 0 deletions.
163 changes: 163 additions & 0 deletions definitions/ext-pi_hole/dashboard.json
Original file line number Diff line number Diff line change
@@ -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
}
]
}
}
22 changes: 22 additions & 0 deletions definitions/ext-pi_hole/definition.yml
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions definitions/ext-pi_hole/golden_metrics.yml
Original file line number Diff line number Diff line change
@@ -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)
14 changes: 14 additions & 0 deletions definitions/ext-pi_hole/summary_metrics.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 5a182a7

Please sign in to comment.