# calculate the rate the disk fills
# use as base, the available space change
-# during the last 30 minutes
+# during the last hour
# this is just a calculation - it has no alarm
# we will use it in the next template to find
template: disk_fill_rate
on: disk.space
- lookup: min -5m at -30m unaligned of avail
- calc: ($this - $avail) / (($now - $after) / 60)
+ lookup: min -10m at -50m unaligned of avail
+ calc: ($this - $avail) / (($now - $after) / 3600)
every: 1m
- units: GB/min
- info: average rate the disk fills up (positive), or frees up (negative) space, for the last 30 minutes
+ units: GB/hour
+ info: average rate the disk fills up (positive), or frees up (negative) space, for the last hour
# calculate the hours remaining
# if the disk continues to fill
# in this rate
-template: out_of_disk_space
+template: out_of_disk_space_time
on: disk.space
- calc: $avail / ($disk_fill_rate * 60)
+ calc: $avail / $disk_fill_rate
every: 10s
- warn: $this > 0 and $this < 48
- crit: $this > 0 and $this < 24
+ warn: $this > 0 and $this < 8
+ crit: $this > 0 and $this < 2
units: hours
- info: estimated time the disk will run out of space, if the system continues to add data with the rate of the last 30 minutes
+ info: estimated time the disk will run out of space, if the system continues to add data with the rate of the last hour
to: sysadmin