@cryptotaxi247 / netdata-1 / commits / 180de8b59

Fix compilation with disable-cloud (#17714)

Remove stale node command not available with disabled cloud

Stelios Fragkakis committed May 20, 2024 at 18:13 UTC 180de8b5982584d0d5493cd0fd4f741689afb9d5
2 files changed +10
src/daemon/commands.c
+8
@@ -47,7 +47,9 @@ static cmd_status_t cmd_ping_execute(char *args, char **message);
47 static cmd_status_t cmd_aclk_state(char *args, char **message);
48 static cmd_status_t cmd_version(char *args, char **message);
49 static cmd_status_t cmd_dumpconfig(char *args, char **message);
50 +#ifdef ENABLE_ACLK
51 static cmd_status_t cmd_remove_node(char *args, char **message);
52 +#endif
53
54 static command_info_t command_info_array[] = {
55 {"help", cmd_help_execute, CMD_TYPE_HIGH_PRIORITY}, // show help menu
@@ -63,7 +65,9 @@ static command_info_t command_info_array[] = {
65 {"aclk-state", cmd_aclk_state, CMD_TYPE_ORTHOGONAL},
66 {"version", cmd_version, CMD_TYPE_ORTHOGONAL},
67 {"dumpconfig", cmd_dumpconfig, CMD_TYPE_ORTHOGONAL},
68 +#ifdef ENABLE_ACLK
69 {"remove-stale-node", cmd_remove_node, CMD_TYPE_ORTHOGONAL}
70 +#endif
71 };
72
73 /* Mutexes for commands of type CMD_TYPE_ORTHOGONAL */
@@ -131,8 +135,10 @@ static cmd_status_t cmd_help_execute(char *args, char **message)
135 " Returns current state of ACLK and Cloud connection. (optionally in json).\n"
136 "dumpconfig\n"
137 " Returns the current netdata.conf on stdout.\n"
138 +#ifdef ENABLE_ACLK
139 "remove-stale-node node_id|machine_guid\n"
140 " Unregisters and removes a node from the cloud.\n"
141 +#endif
142 "version\n"
143 " Returns the netdata version.\n",
144 MAX_COMMAND_LENGTH - 1);
@@ -330,6 +336,7 @@ static cmd_status_t cmd_dumpconfig(char *args, char **message)
336 return CMD_STATUS_SUCCESS;
337 }
338
339 +#ifdef ENABLE_ACLK
340 static cmd_status_t cmd_remove_node(char *args, char **message)
341 {
342 (void)args;
@@ -377,6 +384,7 @@ done:
384 buffer_free(wb);
385 return CMD_STATUS_SUCCESS;
386 }
387 +#endif
388
389 static void cmd_lock_exclusive(unsigned index)
390 {
src/daemon/commands.h
+2
@@ -20,7 +20,9 @@ typedef enum cmd {
20 CMD_ACLK_STATE,
21 CMD_VERSION,
22 CMD_DUMPCONFIG,
23 +#ifdef ENABLE_ACLK
24 CMD_REMOVE_NODE,
25 +#endif
26 CMD_TOTAL_COMMANDS
27 } cmd_t;
28