@cryptotaxi247 / netdata-1 / commits / f0afc344f

adds node_id into mirrored_hosts list (#12307)

Timotej S committed Mar 3, 2022 at 13:56 UTC f0afc344fa7ddcd132fefb8fa1056dbb4294b227
1 file changed +9 -2
web/api/web_api_v1.c
+9 -2
@@ -886,11 +886,18 @@ static inline void web_client_api_request_v1_info_mirrored_hosts(BUFFER *wb) {
886
887 rrdhost_aclk_state_lock(host);
888 if (host->aclk_state.claimed_id)
889 - buffer_sprintf(wb, "\"%s\" }", host->aclk_state.claimed_id);
889 + buffer_sprintf(wb, "\"%s\", ", host->aclk_state.claimed_id);
890 else
891 - buffer_strcat(wb, "null }");
891 + buffer_strcat(wb, "null, ");
892 rrdhost_aclk_state_unlock(host);
893
894 + if (host->node_id) {
895 + char node_id_str[GUID_LEN + 1];
896 + uuid_unparse_lower(*host->node_id, node_id_str);
897 + buffer_sprintf(wb, "\"node_id\": \"%s\" }", node_id_str);
898 + } else
899 + buffer_strcat(wb, "\"node_id\": null }");
900 +
901 count++;
902 }
903 rrd_unlock();