]> arthur.barton.de Git - netdata.git/commitdiff
updated disk alarms
authorCosta Tsaousis <costa@tsaousis.gr>
Tue, 16 Aug 2016 17:21:41 +0000 (20:21 +0300)
committerCosta Tsaousis <costa@tsaousis.gr>
Tue, 16 Aug 2016 17:21:41 +0000 (20:21 +0300)
conf.d/health.d/disks.conf
src/global_statistics.c
src/health.c

index 4f66f92f6414476f09caab3962040a74691e93a2..b550de83a310302a945f3d4772409045dd884567 100644 (file)
@@ -8,34 +8,39 @@
 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
@@ -60,8 +65,8 @@ template: disk_congested
 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
 
index d6277f2d1231715790458a354fdfdeca1e31644a..f39a4cf25575c9ca600b0bc6cfa828b7b7a26416 100644 (file)
@@ -26,7 +26,6 @@ void finished_web_request_statistics(uint64_t dt,
                                      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);
@@ -38,7 +37,7 @@ void finished_web_request_statistics(uint64_t dt,
     __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();
 
index bb9b6c6c445e2d1c214dbe1cff3c5f04b46fb587..b05139b2aaf89a82804cf27e13fc78ea8804d3fa 100644 (file)
@@ -1416,8 +1416,9 @@ void rrdcalc_check_critical_event(RRDCALC *rc) {
     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)
         );
@@ -1433,8 +1434,9 @@ void rrdcalc_check_warning_event(RRDCALC *rc) {
     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)
         );