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,"
"\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;
// health_rrdcalctemplate2json_nolock(wb, rt);
buffer_strcat(wb, "\n\t}\n}\n");
- rrdhost_unlock(localhost);
+ rrdhost_unlock(host);
}