summaryrefslogtreecommitdiffstats
path: root/src/health.c
diff options
context:
space:
mode:
authorFederico Ceratto <federico.ceratto@gmail.com>2017-12-19 23:39:21 +0000
committerFederico Ceratto <federico.ceratto@gmail.com>2017-12-19 23:39:21 +0000
commit61aedf201c2c4bf0e5aa4db32e74f4d860b88593 (patch)
treebcf4f9a0cd8bc2daf38b2ff9f29bfcc1e5ed8968 /src/health.c
parentNew upstream version 1.8.0+dfsg (diff)
downloadnetdata-61aedf201c2c4bf0e5aa4db32e74f4d860b88593.tar.xz
netdata-61aedf201c2c4bf0e5aa4db32e74f4d860b88593.zip
New upstream version 1.9.0+dfsgupstream/1.9.0+dfsg
Diffstat (limited to 'src/health.c')
-rw-r--r--src/health.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/health.c b/src/health.c
index 136a1ecd7..dfa7007b9 100644
--- a/src/health.c
+++ b/src/health.c
@@ -34,10 +34,10 @@ void health_reload_host(RRDHOST *host) {
rrdhost_wrlock(host);
while(host->templates)
- rrdcalctemplate_free(host, host->templates);
+ rrdcalctemplate_unlink_and_free(host, host->templates);
while(host->alarms)
- rrdcalc_free(host, host->alarms);
+ rrdcalc_unlink_and_free(host, host->alarms);
rrdhost_unlock(host);
@@ -84,7 +84,7 @@ void health_reload(void) {
// ----------------------------------------------------------------------------
// health main thread and friends
-static inline int rrdcalc_value2status(calculated_number n) {
+static inline RRDCALC_STATUS rrdcalc_value2status(calculated_number n) {
if(isnan(n) || isinf(n)) return RRDCALC_STATUS_UNDEFINED;
if(n) return RRDCALC_STATUS_RAISED;
return RRDCALC_STATUS_CLEAR;
@@ -189,7 +189,6 @@ static inline void health_alarm_execute(RRDHOST *host, ALARM_ENTRY *ae) {
done:
health_alarm_log_save(host, ae);
- return;
}
static inline void health_process_notifications(RRDHOST *host, ALARM_ENTRY *ae) {
@@ -537,8 +536,8 @@ void *health_main(void *ptr) {
if(unlikely(!(rc->rrdcalc_flags & RRDCALC_FLAG_RUNNABLE)))
continue;
- int warning_status = RRDCALC_STATUS_UNDEFINED;
- int critical_status = RRDCALC_STATUS_UNDEFINED;
+ RRDCALC_STATUS warning_status = RRDCALC_STATUS_UNDEFINED;
+ RRDCALC_STATUS critical_status = RRDCALC_STATUS_UNDEFINED;
// --------------------------------------------------------
// check the warning expression
@@ -605,7 +604,7 @@ void *health_main(void *ptr) {
// --------------------------------------------------------
// decide the final alarm status
- int status = RRDCALC_STATUS_UNDEFINED;
+ RRDCALC_STATUS status = RRDCALC_STATUS_UNDEFINED;
switch(warning_status) {
case RRDCALC_STATUS_CLEAR: