template: low_disk_space
on: disk.space
every: 1m
- warn: $avail * 100 / ($avail + $used) > 80
- crit: $avail * 100 / ($avail + $used) > 90
+ warn: $avail * 100 / ($avail + $used) < 80
+ crit: $avail * 100 / ($avail + $used) < 95
+
# -----------------------------------------------------------------------------
# disk fill rate
# calculate the rate the disk fills
# use as base, the available space change
-# during the last minute
+# during the last 10 minutes
+
+# this is just a calculation - it has no alarm
+# we will use it in the next template to find
+# the hours remaining
-template: disk_fill_rate_1m
+template: disk_fill_rate
on: disk.space
- lookup: max -1s at -1m unaligned of avail
- calc: ($this - $avail) / (1 * 60)
- every: 1m
- warn: $this * 2 * 86400 > $avail
- crit: $this * 1 * 86400 > $avail
+ lookup: max -1s at -10m unaligned of avail
+ calc: ($this - $avail) / (10 * 60)
+ every: 30s
-# calculate the rate the disk fills
-# use as base, the available space change
-# during the last hour
-template: disk_fill_rate_59m
+
+# calculate the hours remaininig
+# if the disk continues to fill
+# in this rate
+
+template: disk_will_fill_in_hours
on: disk.space
- lookup: max -1s at -59m unaligned of avail
- every: 1m
- calc: ($this - $avail) / (59 * 60)
- warn: $this * 2 * 86400 > $avail
- crit: $this * 1 * 86400 > $avail
+ calc: $avail / $disk_fill_rate / 3600
+ every: 10s
+ warn: $this > 0 and $this < 48
+ crit: $this > 0 and $this < 24
+
# -----------------------------------------------------------------------------
# disk congestion
template: disk_not_catching_up
on: disk.backlog
lookup: average -1m every 1m unaligned
- green: 500
- red: 1000
+ green: 1000
+ red: 2000
warn: $this > $green
crit: $this > $red
uint64_t content_size,
uint64_t compressed_content_size) {
#ifndef NETDATA_NO_ATOMIC_INSTRUCTIONS
-#warning using atomic operations
uint64_t old_web_usec_max = global_statistics.web_usec_max;
while(dt > old_web_usec_max)
__atomic_compare_exchange(&global_statistics.web_usec_max, &old_web_usec_max, &dt, 1, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST);
__atomic_fetch_add(&global_statistics.content_size, content_size, __ATOMIC_SEQ_CST);
__atomic_fetch_add(&global_statistics.compressed_content_size, compressed_content_size, __ATOMIC_SEQ_CST);
#else
- #warning NOT using atomic operations
+#warning NOT using atomic operations - using locks for global statistics
if (web_server_mode == WEB_SERVER_MODE_MULTI_THREADED)
global_statistics_lock();
int new_status = rrdcalc_value2status(n);
if(new_status != old_status) {
- info("Health alarm '%s.%s' - CRITICAL condition changed status from %s to %s",
+ info("Health alarm '%s.%s' = %0.2Lf - CRITICAL condition changed status from %s to %s",
rc->chart?rc->chart:"NOCHART", rc->name,
+ rc->value,
rrdcalc_status2string(old_status),
rrdcalc_status2string(new_status)
);
int new_status = rrdcalc_value2status(n);
if(new_status != old_status) {
- info("Health alarm '%s.%s' - WARNING condition changed status from %s to %s",
+ info("Health alarm '%s.%s' = %0.2Lf - WARNING condition changed status from %s to %s",
rc->chart?rc->chart:"NOCHART", rc->name,
+ rc->value,
rrdcalc_status2string(old_status),
rrdcalc_status2string(new_status)
);