mirror of
https://github.com/netdata/netdata.git
synced 2025-05-06 18:20:10 +00:00
add more information about claiming failures (#19735)
This commit is contained in:
parent
4c3a8a4e2c
commit
337d603093
3 changed files with 13 additions and 5 deletions
src/claim
|
@ -148,7 +148,7 @@ static int debug_callback(CURL *handle, curl_infotype type, char *data, size_t s
|
||||||
return 0;
|
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;
|
CURL *curl;
|
||||||
CURLcode res;
|
CURLcode res;
|
||||||
char target_url[2048];
|
char target_url[2048];
|
||||||
|
@ -270,8 +270,16 @@ static bool send_curl_request(const char *machine_guid, const char *hostname, co
|
||||||
// execute the request
|
// execute the request
|
||||||
res = curl_easy_perform(curl);
|
res = curl_easy_perform(curl);
|
||||||
if (res != CURLE_OK) {
|
if (res != CURLE_OK) {
|
||||||
claim_agent_failure_reason_set("Request failed with error: %s (proxy is set to '%s')",
|
claim_agent_failure_reason_set("Request failed with error: %s\n"
|
||||||
curl_easy_strerror(res), proxy);
|
"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_easy_cleanup(curl);
|
||||||
curl_slist_free_all(headers);
|
curl_slist_free_all(headers);
|
||||||
*can_retry = true;
|
*can_retry = true;
|
||||||
|
|
|
@ -24,7 +24,7 @@ bool load_claiming_state(void);
|
||||||
void cloud_conf_load(int silent);
|
void cloud_conf_load(int silent);
|
||||||
void cloud_conf_init_after_registry(void);
|
void cloud_conf_init_after_registry(void);
|
||||||
bool cloud_conf_save(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);
|
CLOUD_STATUS claim_reload_and_wait_online(void);
|
||||||
|
|
||||||
const char *cloud_config_url_get(void);
|
const char *cloud_config_url_get(void);
|
||||||
|
|
|
@ -102,7 +102,7 @@ bool cloud_conf_save(void) {
|
||||||
return true;
|
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
|
// for backwards compatibility (older agents), save the claimed_id to its file
|
||||||
claimed_id_save_to_file(claimed_id_str);
|
claimed_id_save_to_file(claimed_id_str);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue