]> arthur.barton.de Git - netdata.git/blobdiff - src/health_json.c
Merge pull request #1895 from l2isbad/web_log_improvements
[netdata.git] / src / health_json.c
index 0af68d3530af2e55acc088c32258d3f2b11562b5..4d24d5d11f075c77f0cd12bbbea515b7ca9164b1 100644 (file)
@@ -219,7 +219,7 @@ static inline void health_rrdcalc2json_nolock(RRDHOST *host, BUFFER *wb, RRDCALC
 void health_alarms2json(RRDHOST *host, BUFFER *wb, int all) {
     int i;
 
-    rrdhost_rdlock(localhost);
+    rrdhost_rdlock(host);
     buffer_sprintf(wb, "{\n\t\"hostname\": \"%s\","
                     "\n\t\"latest_alarm_log_unique_id\": %u,"
                     "\n\t\"status\": %s,"
@@ -227,7 +227,7 @@ void health_alarms2json(RRDHOST *host, BUFFER *wb, int all) {
                     "\n\t\"alarms\": {\n",
             host->hostname,
             (host->health_log.next_log_id > 0)?(host->health_log.next_log_id - 1):0,
-            health_enabled?"true":"false",
+            host->health_enabled?"true":"false",
             (unsigned long)now_realtime_sec());
 
     RRDCALC *rc;
@@ -249,7 +249,7 @@ void health_alarms2json(RRDHOST *host, BUFFER *wb, int all) {
 //        health_rrdcalctemplate2json_nolock(wb, rt);
 
     buffer_strcat(wb, "\n\t}\n}\n");
-    rrdhost_unlock(localhost);
+    rrdhost_unlock(host);
 }