updated disk alarms
Costa Tsaousis committed
Aug 16, 2016 at 20:21 UTC
f462b21b3c24893a66acb94f1ca8b8079065efc7
3 files changed
+30
-24
conf.d/health.d/disks.conf
+25
-20
@@ -8,34 +8,39 @@
8
template: low_disk_space
9
on: disk.space
10
every: 1m
11
- warn: $avail * 100 / ($avail + $used) > 80
12
- crit: $avail * 100 / ($avail + $used) > 90
11
+ warn: $avail * 100 / ($avail + $used) < 80
12
+ crit: $avail * 100 / ($avail + $used) < 95
13
+
14
15
# -----------------------------------------------------------------------------
16
# disk fill rate
17
18
# calculate the rate the disk fills
19
# use as base, the available space change
19
-# during the last minute
20
+# during the last 10 minutes
21
+
22
+# this is just a calculation - it has no alarm
23
+# we will use it in the next template to find
24
+# the hours remaining
25
21
-template: disk_fill_rate_1m
26
+template: disk_fill_rate
27
on: disk.space
23
- lookup: max -1s at -1m unaligned of avail
24
- calc: ($this - $avail) / (1 * 60)
25
- every: 1m
26
- warn: $this * 2 * 86400 > $avail
27
- crit: $this * 1 * 86400 > $avail
28
+ lookup: max -1s at -10m unaligned of avail
29
+ calc: ($this - $avail) / (10 * 60)
30
+ every: 30s
31
29
-# calculate the rate the disk fills
30
-# use as base, the available space change
31
-# during the last hour
32
-template: disk_fill_rate_59m
32
+
33
+# calculate the hours remaininig
34
+# if the disk continues to fill
35
+# in this rate
36
+
37
+template: disk_will_fill_in_hours
38
on: disk.space
34
- lookup: max -1s at -59m unaligned of avail
35
- every: 1m
36
- calc: ($this - $avail) / (59 * 60)
37
- warn: $this * 2 * 86400 > $avail
38
- crit: $this * 1 * 86400 > $avail
39
+ calc: $avail / $disk_fill_rate / 3600
40
+ every: 10s
41
+ warn: $this > 0 and $this < 48
42
+ crit: $this > 0 and $this < 24
43
+
44
45
# -----------------------------------------------------------------------------
46
# disk congestion
@@ -60,8 +65,8 @@ template: disk_congested
65
template: disk_not_catching_up
66
on: disk.backlog
67
lookup: average -1m every 1m unaligned
63
- green: 500
64
- red: 1000
68
+ green: 1000
69
+ red: 2000
70
warn: $this > $green
71
crit: $this > $red
72
src/global_statistics.c
+1
-2
@@ -26,7 +26,6 @@ void finished_web_request_statistics(uint64_t dt,
26
uint64_t content_size,
27
uint64_t compressed_content_size) {
28
#ifndef NETDATA_NO_ATOMIC_INSTRUCTIONS
29
-#warning using atomic operations
29
uint64_t old_web_usec_max = global_statistics.web_usec_max;
30
while(dt > old_web_usec_max)
31
__atomic_compare_exchange(&global_statistics.web_usec_max, &old_web_usec_max, &dt, 1, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST);
@@ -38,7 +37,7 @@ void finished_web_request_statistics(uint64_t dt,
37
__atomic_fetch_add(&global_statistics.content_size, content_size, __ATOMIC_SEQ_CST);
38
__atomic_fetch_add(&global_statistics.compressed_content_size, compressed_content_size, __ATOMIC_SEQ_CST);
39
#else
41
- #warning NOT using atomic operations
40
+#warning NOT using atomic operations - using locks for global statistics
41
if (web_server_mode == WEB_SERVER_MODE_MULTI_THREADED)
42
global_statistics_lock();
43
src/health.c
+4
-2
@@ -1416,8 +1416,9 @@ void rrdcalc_check_critical_event(RRDCALC *rc) {
1416
int new_status = rrdcalc_value2status(n);
1417
1418
if(new_status != old_status) {
1419
- info("Health alarm '%s.%s' - CRITICAL condition changed status from %s to %s",
1419
+ info("Health alarm '%s.%s' = %0.2Lf - CRITICAL condition changed status from %s to %s",
1420
rc->chart?rc->chart:"NOCHART", rc->name,
1421
+ rc->value,
1422
rrdcalc_status2string(old_status),
1423
rrdcalc_status2string(new_status)
1424
);
@@ -1433,8 +1434,9 @@ void rrdcalc_check_warning_event(RRDCALC *rc) {
1434
int new_status = rrdcalc_value2status(n);
1435
1436
if(new_status != old_status) {
1436
- info("Health alarm '%s.%s' - WARNING condition changed status from %s to %s",
1437
+ info("Health alarm '%s.%s' = %0.2Lf - WARNING condition changed status from %s to %s",
1438
rc->chart?rc->chart:"NOCHART", rc->name,
1439
+ rc->value,
1440
rrdcalc_status2string(old_status),
1441
rrdcalc_status2string(new_status)
1442
);