0
0
Fork 0
mirror of https://github.com/netdata/netdata.git synced 2025-04-21 04:10:38 +00:00

add more information about claiming failures ()

This commit is contained in:
Costa Tsaousis 2025-02-28 13:39:29 +00:00 committed by GitHub
parent 4c3a8a4e2c
commit 337d603093
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 13 additions and 5 deletions

View file

@ -148,7 +148,7 @@ static int debug_callback(CURL *handle, curl_infotype type, char *data, size_t s
return 0;
}
static bool send_curl_request(const char *machine_guid, const char *hostname, const char *token, const char *rooms, const char *url, const char *proxy, int insecure, bool *can_retry) {
static bool send_curl_request(const char *machine_guid, const char *hostname, const char *token, const char *rooms, const char *url, const char *proxy, bool insecure, bool *can_retry) {
CURL *curl;
CURLcode res;
char target_url[2048];
@ -270,8 +270,16 @@ static bool send_curl_request(const char *machine_guid, const char *hostname, co
// execute the request
res = curl_easy_perform(curl);
if (res != CURLE_OK) {
claim_agent_failure_reason_set("Request failed with error: %s (proxy is set to '%s')",
curl_easy_strerror(res), proxy);
claim_agent_failure_reason_set("Request failed with error: %s\n"
"proxy: '%s',\n"
"insecure: %s,\n"
"public key file: '%s',\n"
"trusted key file: '%s'",
curl_easy_strerror(res),
proxy,
insecure ? "true" : "false",
public_key_file ? public_key_file : "none",
trusted_key_file ? trusted_key_file : "none");
curl_easy_cleanup(curl);
curl_slist_free_all(headers);
*can_retry = true;

View file

@ -24,7 +24,7 @@ bool load_claiming_state(void);
void cloud_conf_load(int silent);
void cloud_conf_init_after_registry(void);
bool cloud_conf_save(void);
bool cloud_conf_regenerate(const char *claimed_id_str, const char *machine_guid, const char *hostname, const char *token, const char *rooms, const char *url, const char *proxy, int insecure);
bool cloud_conf_regenerate(const char *claimed_id_str, const char *machine_guid, const char *hostname, const char *token, const char *rooms, const char *url, const char *proxy, bool insecure);
CLOUD_STATUS claim_reload_and_wait_online(void);
const char *cloud_config_url_get(void);

View file

@ -102,7 +102,7 @@ bool cloud_conf_save(void) {
return true;
}
bool cloud_conf_regenerate(const char *claimed_id_str, const char *machine_guid, const char *hostname, const char *token, const char *rooms, const char *url, const char *proxy, int insecure) {
bool cloud_conf_regenerate(const char *claimed_id_str, const char *machine_guid, const char *hostname, const char *token, const char *rooms, const char *url, const char *proxy, bool insecure) {
// for backwards compatibility (older agents), save the claimed_id to its file
claimed_id_save_to_file(claimed_id_str);