@cryptotaxi247 / netdata-1 / commits / d4f3ca33a

added backed alarms

Costa Tsaousis (ktsaou) committed Nov 20, 2016 at 17:03 UTC d4f3ca33af3e40d31eb5479f6dbcb152cd9f984a
3 files changed +48 -3
conf.d/Makefile.am
+1
@@ -52,6 +52,7 @@ dist_pythonconfig_DATA = \
52 healthconfigdir=$(configdir)/health.d
53 dist_healthconfig_DATA = \
54 health.d/apache.conf \
55 + health.d/backend.conf \
56 health.d/cpu.conf \
57 health.d/disks.conf \
58 health.d/entropy.conf \
conf.d/health.d/backend.conf new
+44
@@ -0,0 +1,44 @@
1 +
2 +# make sure we are sending data to backend
3 +
4 + alarm: backend_last_buffering
5 + on: netdata.backend_metrics
6 + calc: $now - $last_collected_t
7 + units: seconds ago
8 + every: 10s
9 + warn: $this > (($status >= $WARNING) ? ($update_every) : ( 5 * $update_every))
10 + crit: $this > (($status == $CRITICAL) ? ($update_every) : (60 * $update_every))
11 + delay: down 5m multiplier 1.5 max 1h
12 + info: number of seconds since the last successful buffering of backend data
13 + to: dba
14 +
15 + alarm: backend_metrics_sent
16 + on: netdata.backend_metrics
17 + units: %
18 + calc: $sent * 100 / $buffered
19 + every: 10s
20 + warn: $this != 100
21 + delay: down 5m multiplier 1.5 max 1h
22 + info: percentage of metrics sent to the backend server
23 + to: dba
24 +
25 + alarm: backend_metrics_lost
26 + on: netdata.backend_metrics
27 + units: metrics
28 + calc: $lost
29 + every: 10s
30 + crit: $this != 0
31 + delay: down 5m multiplier 1.5 max 1h
32 + info: number of metrics lost due to repeating failures to contact the backend server
33 + to: dba
34 +
35 + alarm: backend_slow
36 + on: netdata.backend_latency
37 + units: %
38 + calc: $latency * 100 / ($update_every * 1000)
39 + every: 10s
40 + warn: $this > 50
41 + crit: $this > 100
42 + delay: down 5m multiplier 1.5 max 1h
43 + info: the percentage of time between iterations needed by the backend time to process the data sent by netdata
44 + to: dba
src/backends.c
+3 -3
@@ -164,7 +164,7 @@ static inline int connect_to_one(const char *definition, int default_port, struc
164 return fd;
165 }
166
167 -static inline calculated_number backend_duration_average(RRDSET *st, RRDDIM *rd, time_t after, time_t before, uint32_t options) {
167 +static inline calculated_number backend_calculate_value_from_stored_data(RRDSET *st, RRDDIM *rd, time_t after, time_t before, uint32_t options) {
168 time_t first_t = rrdset_first_entry_t(st);
169 time_t last_t = rrdset_last_entry_t(st);
170
@@ -227,7 +227,7 @@ static inline int format_dimension_collected_graphite_plaintext(BUFFER *b, const
227
228 static inline int format_dimension_stored_graphite_plaintext(BUFFER *b, const char *prefix, RRDHOST *host, const char *hostname, RRDSET *st, RRDDIM *rd, time_t after, time_t before, uint32_t options) {
229 (void)host;
230 - calculated_number value = backend_duration_average(st, rd, after, before, options);
230 + calculated_number value = backend_calculate_value_from_stored_data(st, rd, after, before, options);
231 if(!isnan(value)) {
232 buffer_sprintf(b, "%s.%s.%s.%s " CALCULATED_NUMBER_FORMAT " %u\n", prefix, hostname, st->id, rd->id, value, (uint32_t) before);
233 return 1;
@@ -246,7 +246,7 @@ static inline int format_dimension_collected_opentsdb_telnet(BUFFER *b, const ch
246
247 static inline int format_dimension_stored_opentsdb_telnet(BUFFER *b, const char *prefix, RRDHOST *host, const char *hostname, RRDSET *st, RRDDIM *rd, time_t after, time_t before, uint32_t options) {
248 (void)host;
249 - calculated_number value = backend_duration_average(st, rd, after, before, options);
249 + calculated_number value = backend_calculate_value_from_stored_data(st, rd, after, before, options);
250 if(!isnan(value)) {
251 buffer_sprintf(b, "put %s.%s.%s %u " CALCULATED_NUMBER_FORMAT " host=%s\n", prefix, st->id, rd->id, (uint32_t) before, value, hostname);
252 return 1;