Browse Source

btrfs alarms should report used, not free

Costa Tsaousis (ktsaou) 7 years ago
parent
commit
93f5e25cf8
1 changed files with 17 additions and 17 deletions
  1. 17 17
      conf.d/health.d/btrfs.conf

+ 17 - 17
conf.d/health.d/btrfs.conf

@@ -1,16 +1,16 @@
 
-template: btrfs_unallocated
+template: btrfs_allocated
       on: btrfs.disk
       os: *
    hosts: *
 families: *
-    calc: $unallocated * 100 / ($unallocated + $data_used + $data_free + $meta_used + $meta_free + $sys_used + $sys_free)
+    calc: 100 - ($unallocated * 100 / ($unallocated + $data_used + $data_free + $meta_used + $meta_free + $sys_used + $sys_free))
    units: %
    every: 10s
-    warn: $this < (($status >= $WARNING)  ? (10) : (5))
-    crit: $this < (($status == $CRITICAL) ? ( 5) : (1))
+    warn: $this > (($status >= $WARNING)  ? (90) : (95))
+    crit: $this > (($status == $CRITICAL) ? (95) : (98))
    delay: up 1m down 15m multiplier 1.5 max 1h
-    info: the percentage of unallocated BTRFS physical disk space
+    info: the percentage of allocated BTRFS physical disk space
       to: sysadmin
 
 template: btrfs_data
@@ -18,13 +18,13 @@ template: btrfs_data
       os: *
    hosts: *
 families: *
-    calc: $free * 100 / ($used + $free)
+    calc: $used * 100 / ($used + $free)
    units: %
    every: 10s
-    warn: $this < (($status >= $WARNING)  ? (10) : (5)) && $btrfs_unallocated < 1
-    crit: $this < (($status == $CRITICAL) ? ( 5) : (1)) && $btrfs_unallocated < 1
+    warn: $this > (($status >= $WARNING)  ? (90) : (95)) && $btrfs_allocated > 98
+    crit: $this > (($status == $CRITICAL) ? (95) : (98)) && $btrfs_allocated > 98
    delay: up 1m down 15m multiplier 1.5 max 1h
-    info: the percentage of free BTRFS data space
+    info: the percentage of used BTRFS data space
       to: sysadmin
 
 template: btrfs_metadata
@@ -32,13 +32,13 @@ template: btrfs_metadata
       os: *
    hosts: *
 families: *
-    calc: $free * 100 / ($used + $free + $reserved)
+    calc: ($used + $reserved) * 100 / ($used + $free + $reserved)
    units: %
    every: 10s
-    warn: $this < (($status >= $WARNING)  ? (10) : (5)) && $btrfs_unallocated < 1
-    crit: $this < (($status == $CRITICAL) ? ( 5) : (1)) && $btrfs_unallocated < 1
+    warn: $this > (($status >= $WARNING)  ? (90) : (95)) && $btrfs_allocated > 98
+    crit: $this > (($status == $CRITICAL) ? (95) : (98)) && $btrfs_allocated > 98
    delay: up 1m down 15m multiplier 1.5 max 1h
-    info: the percentage of free BTRFS metadata space
+    info: the percentage of used BTRFS metadata space
       to: sysadmin
 
 template: btrfs_system
@@ -46,12 +46,12 @@ template: btrfs_system
       os: *
    hosts: *
 families: *
-    calc: $free * 100 / ($used + $free)
+    calc: $used * 100 / ($used + $free)
    units: %
    every: 10s
-    warn: $this < (($status >= $WARNING)  ? (10) : (5)) && $btrfs_unallocated < 1
-    crit: $this < (($status == $CRITICAL) ? ( 5) : (1)) && $btrfs_unallocated < 1
+    warn: $this > (($status >= $WARNING)  ? (90) : (95)) && $btrfs_allocated > 98
+    crit: $this > (($status == $CRITICAL) ? (95) : (98)) && $btrfs_allocated > 98
    delay: up 1m down 15m multiplier 1.5 max 1h
-    info: the percentage of free BTRFS system space
+    info: the percentage of used BTRFS system space
       to: sysadmin