diff --git a/collectors/plugins.d/pluginsd_parser.c b/collectors/plugins.d/pluginsd_parser.c index 19aa4544b23efa..8be6f428f45e8a 100644 --- a/collectors/plugins.d/pluginsd_parser.c +++ b/collectors/plugins.d/pluginsd_parser.c @@ -2397,6 +2397,9 @@ PARSER_RC parser_execute(PARSER *parser, PARSER_KEYWORD *keyword, char **words, case 102: return pluginsd_register_module(words, num_words, parser); + case 110: + return pluginsd_job_status(words, num_words, parser); + default: fatal("Unknown keyword '%s' with id %zu", keyword->keyword, keyword->id); } diff --git a/libnetdata/dyn_conf/dyn_conf.h b/libnetdata/dyn_conf/dyn_conf.h index f10ae6a12747c0..2569142fb40f2f 100644 --- a/libnetdata/dyn_conf/dyn_conf.h +++ b/libnetdata/dyn_conf/dyn_conf.h @@ -37,7 +37,7 @@ enum job_status { JOB_STATUS_ERROR }; -inline enum job_status str2job_state(const char *state_name) { +static inline enum job_status str2job_state(const char *state_name) { if (strcmp(state_name, "stopped") == 0) return JOB_STATUS_STOPPED; else if (strcmp(state_name, "running") == 0) @@ -57,7 +57,7 @@ struct job { char *name; - //state reported by config + // state reported by plugin enum job_status status; // reported by plugin, enum as this has to be interpreted by UI int state; // code reported by plugin which can mean anything plugin wants char *reason; // reported by plugin, can be NULL (optional) diff --git a/web/api/web_api_v2.c b/web/api/web_api_v2.c index 850282121eb744..5921db1682a91f 100644 --- a/web/api/web_api_v2.c +++ b/web/api/web_api_v2.c @@ -657,8 +657,10 @@ static int web_client_api_request_v2_config(RRDHOST *host __maybe_unused, struct char *url = strdupz(buffer_tostring(w->url_as_received)); char *url_full = url; + buffer_flush(w->response.data); if (strncmp(url, CONFIG_API_V2_URL, strlen(CONFIG_API_V2_URL)) != 0) { buffer_sprintf(w->response.data, "Invalid URL"); + freez(url_full); return HTTP_RESP_BAD_REQUEST; } url += strlen(CONFIG_API_V2_URL); @@ -669,7 +671,6 @@ static int web_client_api_request_v2_config(RRDHOST *host __maybe_unused, struct char *job_id = strtok_r(NULL, "/", &save_ptr); char *extra = strtok_r(NULL, "/", &save_ptr); - buffer_flush(w->response.data); if (extra != NULL) { buffer_sprintf(w->response.data, "Invalid URL"); freez(url_full);