btrfs alarms should report used, not free
Costa Tsaousis (ktsaou) committed
Dec 19, 2017 at 01:07 UTC
93f5e25cf823e6546fd0553818c125ecdfbb499c
1 file changed
+17
-17
conf.d/health.d/btrfs.conf
+17
-17
@@ -1,16 +1,16 @@
1
2
-template: btrfs_unallocated
2
+template: btrfs_allocated
3
on: btrfs.disk
4
os: *
5
hosts: *
6
families: *
7
- calc: $unallocated * 100 / ($unallocated + $data_used + $data_free + $meta_used + $meta_free + $sys_used + $sys_free)
7
+ calc: 100 - ($unallocated * 100 / ($unallocated + $data_used + $data_free + $meta_used + $meta_free + $sys_used + $sys_free))
8
units: %
9
every: 10s
10
- warn: $this < (($status >= $WARNING) ? (10) : (5))
11
- crit: $this < (($status == $CRITICAL) ? ( 5) : (1))
10
+ warn: $this > (($status >= $WARNING) ? (90) : (95))
11
+ crit: $this > (($status == $CRITICAL) ? (95) : (98))
12
delay: up 1m down 15m multiplier 1.5 max 1h
13
- info: the percentage of unallocated BTRFS physical disk space
13
+ info: the percentage of allocated BTRFS physical disk space
14
to: sysadmin
15
16
template: btrfs_data
@@ -18,13 +18,13 @@ template: btrfs_data
18
os: *
19
hosts: *
20
families: *
21
- calc: $free * 100 / ($used + $free)
21
+ calc: $used * 100 / ($used + $free)
22
units: %
23
every: 10s
24
- warn: $this < (($status >= $WARNING) ? (10) : (5)) && $btrfs_unallocated < 1
25
- crit: $this < (($status == $CRITICAL) ? ( 5) : (1)) && $btrfs_unallocated < 1
24
+ warn: $this > (($status >= $WARNING) ? (90) : (95)) && $btrfs_allocated > 98
25
+ crit: $this > (($status == $CRITICAL) ? (95) : (98)) && $btrfs_allocated > 98
26
delay: up 1m down 15m multiplier 1.5 max 1h
27
- info: the percentage of free BTRFS data space
27
+ info: the percentage of used BTRFS data space
28
to: sysadmin
29
30
template: btrfs_metadata
@@ -32,13 +32,13 @@ template: btrfs_metadata
32
os: *
33
hosts: *
34
families: *
35
- calc: $free * 100 / ($used + $free + $reserved)
35
+ calc: ($used + $reserved) * 100 / ($used + $free + $reserved)
36
units: %
37
every: 10s
38
- warn: $this < (($status >= $WARNING) ? (10) : (5)) && $btrfs_unallocated < 1
39
- crit: $this < (($status == $CRITICAL) ? ( 5) : (1)) && $btrfs_unallocated < 1
38
+ warn: $this > (($status >= $WARNING) ? (90) : (95)) && $btrfs_allocated > 98
39
+ crit: $this > (($status == $CRITICAL) ? (95) : (98)) && $btrfs_allocated > 98
40
delay: up 1m down 15m multiplier 1.5 max 1h
41
- info: the percentage of free BTRFS metadata space
41
+ info: the percentage of used BTRFS metadata space
42
to: sysadmin
43
44
template: btrfs_system
@@ -46,12 +46,12 @@ template: btrfs_system
46
os: *
47
hosts: *
48
families: *
49
- calc: $free * 100 / ($used + $free)
49
+ calc: $used * 100 / ($used + $free)
50
units: %
51
every: 10s
52
- warn: $this < (($status >= $WARNING) ? (10) : (5)) && $btrfs_unallocated < 1
53
- crit: $this < (($status == $CRITICAL) ? ( 5) : (1)) && $btrfs_unallocated < 1
52
+ warn: $this > (($status >= $WARNING) ? (90) : (95)) && $btrfs_allocated > 98
53
+ crit: $this > (($status == $CRITICAL) ? (95) : (98)) && $btrfs_allocated > 98
54
delay: up 1m down 15m multiplier 1.5 max 1h
55
- info: the percentage of free BTRFS system space
55
+ info: the percentage of used BTRFS system space
56
to: sysadmin
57