@cryptotaxi247 / netdata-1 / commits / d72465d9b

Allow indirect access when agent is claimed, but offline (indirect cloud connectivity) (#19611)

use the parent claim id when agent is claimed but not connected to netdata cloud

Costa Tsaousis committed Feb 10, 2025 at 17:40 UTC d72465d9bac53a4e5cfed5a31b5e76c7265d9872
3 files changed +3 -3
src/claim/claim_id.c
+1 -1
@@ -106,7 +106,7 @@ CLAIM_ID rrdhost_claim_id_get(RRDHOST *host) {
106
107 if(host == localhost) {
108 ret.uuid = claim_id_get_uuid();
109 - if(UUIDiszero(ret.uuid))
109 + if(UUIDiszero(ret.uuid) || (!aclk_online() && !UUIDiszero(host->aclk.claim_id_of_parent)))
110 ret.uuid = host->aclk.claim_id_of_parent;
111 }
112 else {
src/claim/cloud-status.c
+1 -1
@@ -107,7 +107,7 @@ CLOUD_STATUS buffer_json_cloud_status(BUFFER *wb, time_t now_s) {
107
108 case CLOUD_STATUS_OFFLINE: {
109 // the agent is claimed, but cannot get online
110 - CLAIM_ID claim_id = claim_id_get();
110 + CLAIM_ID claim_id = rrdhost_claim_id_get(localhost);
111 buffer_json_member_add_string(wb, "claim_id", claim_id.str);
112 buffer_json_member_add_string(wb, "url", cloud_status_aclk_base_url());
113 buffer_json_member_add_string(wb, "reason", cloud_status_aclk_offline_reason());
src/registry/registry.c
+1 -1
@@ -174,7 +174,7 @@ int registry_request_hello_json(RRDHOST *host, struct web_client *w, bool do_not
174 if(!UUIDiszero(localhost->node_id))
175 buffer_json_member_add_uuid(w->response.data, "node_id", localhost->node_id.uuid);
176
177 - CLAIM_ID claim_id = claim_id_get();
177 + CLAIM_ID claim_id = rrdhost_claim_id_get(host);
178 if (claim_id_is_set(claim_id))
179 buffer_json_member_add_string(w->response.data, "claim_id", claim_id.str);
180