diff options
Diffstat (limited to 'daemon/commands.c')
-rw-r--r-- | daemon/commands.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/daemon/commands.c b/daemon/commands.c index 5eb22a6693..b12c19216b 100644 --- a/daemon/commands.c +++ b/daemon/commands.c @@ -40,6 +40,7 @@ static cmd_status_t cmd_save_database_execute(char *args, char **message); static cmd_status_t cmd_reopen_logs_execute(char *args, char **message); static cmd_status_t cmd_exit_execute(char *args, char **message); static cmd_status_t cmd_fatal_execute(char *args, char **message); +static cmd_status_t cmd_reload_claiming_state_execute(char *args, char **message); static cmd_status_t cmd_reload_labels_execute(char *args, char **message); static command_info_t command_info_array[] = { @@ -49,6 +50,7 @@ static command_info_t command_info_array[] = { {"reopen-logs", cmd_reopen_logs_execute, CMD_TYPE_ORTHOGONAL}, // Close and reopen log files {"shutdown-agent", cmd_exit_execute, CMD_TYPE_EXCLUSIVE}, // exit cleanly {"fatal-agent", cmd_fatal_execute, CMD_TYPE_HIGH_PRIORITY}, // exit with fatal error + {"reload-claiming-state", cmd_reload_claiming_state_execute, CMD_TYPE_ORTHOGONAL}, // reload claiming state {"reload-labels", cmd_reload_labels_execute, CMD_TYPE_ORTHOGONAL}, // reload the labels }; @@ -108,7 +110,9 @@ static cmd_status_t cmd_help_execute(char *args, char **message) "shutdown-agent\n" " Cleanup and exit the netdata agent.\n" "fatal-agent\n" - " Log the state and halt the netdata agent.\n", + " Log the state and halt the netdata agent.\n" + "reload-claiming-state\n" + " Reload agent claiming state from disk.\n", MAX_COMMAND_LENGTH - 1); return CMD_STATUS_SUCCESS; } @@ -176,6 +180,21 @@ static cmd_status_t cmd_fatal_execute(char *args, char **message) return CMD_STATUS_SUCCESS; } +static cmd_status_t cmd_reload_claiming_state_execute(char *args, char **message) +{ + (void)args; + (void)message; + + info("The claiming feature is still in development and subject to change before the next release"); + return CMD_STATUS_FAILURE; + + error_log_limit_unlimited(); + info("COMMAND: Reloading Agent Claiming configuration."); + load_claiming_state(); + error_log_limit_reset(); + return CMD_STATUS_SUCCESS; +} + static cmd_status_t cmd_reload_labels_execute(char *args, char **message) { (void)args; |