pihole collector: add alarms (#6320)
* add pihole alarms
Ilya Mashchenko committed
Jun 24, 2019 at 11:39 UTC
0f1b26b69aaa9e58556d5715aeff8243954c7347
2 files changed
+68
health/Makefile.am
+1
@@ -63,6 +63,7 @@ dist_healthconfig_DATA = \
63
health.d/netfilter.conf \
64
health.d/nginx.conf \
65
health.d/nginx_plus.conf \
66
+ health.d/pihole.conf \
67
health.d/phpfpm.conf \
68
health.d/portcheck.conf \
69
health.d/postgres.conf \
health/health.d/pihole.conf
new
+67
@@ -0,0 +1,67 @@
1
+
2
+ # Make sure Pi-hole is responding.
3
+
4
+template: pihole_last_collected_secs
5
+ on: pihole.dns_queries_total
6
+ calc: $now - $last_collected_t
7
+ units: seconds ago
8
+ every: 10s
9
+ warn: $this > (($status >= $WARNING) ? ($update_every) : ( 5 * $update_every))
10
+ crit: $this > (($status == $CRITICAL) ? ($update_every) : (60 * $update_every))
11
+ delay: down 5m multiplier 1.5 max 1h
12
+ info: number of seconds since the last successful data collection
13
+ to: webmaster
14
+
15
+ # Blocked DNS queries.
16
+
17
+ template: pihole_blocked_queries
18
+ on: pihole.dns_queries_percentage
19
+ every: 10s
20
+ units: %
21
+ calc: $blocked
22
+ warn: $this > ( ($status >= $WARNING ) ? ( 45 ) : ( 55 ) )
23
+ crit: $this > ( ($status >= $CRITICAL) ? ( 55 ) : ( 75 ) )
24
+ delay: delay 2m down 5m
25
+ info: percentage of blocked dns queries for the last 24 hour
26
+ to: sysadmin
27
+
28
+
29
+ # Blocklist last update time.
30
+ # Default update interval is a week.
31
+
32
+ template: pihole_blocklist_last_update
33
+ on: pihole.blocklist_last_update
34
+ every: 10s
35
+ units: seconds
36
+ calc: $ago
37
+ warn: $this > 60 * 60 * 24 * 8
38
+ crit: $this > 60 * 60 * 24 * 8 * 2
39
+ info: blocklist last update time
40
+ to: sysadmin
41
+
42
+
43
+ # Gravity file check (gravity.list).
44
+
45
+ template: pihole_blocklist_gravity_file
46
+ on: pihole.blocklist_last_update
47
+ every: 10s
48
+ units: boolean
49
+ calc: $file_exists
50
+ crit: $this != 1
51
+ delay: delay 2m down 5m
52
+ info: gravity file existence
53
+ to: sysadmin
54
+
55
+
56
+ # Pi-hole's ability to block unwanted domains.
57
+ # Should be enabled. The whole point of Pi-hole!
58
+
59
+ template: pihole_status
60
+ on: pihole.unwanted_domains_blocking_status
61
+ every: 10s
62
+ units: boolean
63
+ calc: $enabled
64
+ warn: $this != 1
65
+ delay: delay 2m down 5m
66
+ info: unwanted domains blocking status
67
+ to: sysadmin