mirror of
https://github.com/netdata/netdata.git
synced 2025-05-03 00:40:12 +00:00

* cleanup alerts * fix references * fix references * fix references * load alerts once and apply them to each node * simplify health_create_alarm_entry() * Compile without warnings with compiler flags: -Wall -Wextra -Wformat=2 -Wshadow -Wno-format-nonliteral -Winit-self * code re-organization and cleanup * generate patterns when applying prototypes; give unique dyncfg names to all alerts * eval expressions keep the source and the parsed_as as STRING pointers * renamed host to node in dyncfg ids * renamed host to node in dyncfg ids * add all cloud roles to the list of parsed X-Netdata-Role header and also default to member access level * working functionality * code re-organization: moved health event-loop to a new file, moved health globals to health.c * rrdcalctemplate is removed; alert_cfg is removed; foreach dimension is removed; RRDCALCs are now instanciated only when they are linked to RRDSETs * dyncfg alert prototypes initialization for alerts * health dyncfg split to separate file * cleanup not-needed code * normalize matches between parsing and json * also detect !* for disabled alerts * dyncfg capability disabled * Store alert config part1 * Add rrdlabels_common_count * wip health variables lookup without indexes * Improve rrdlabels_common_count by reusing rrdlabels_find_label_with_key_unsafe with an additional parameter * working variables with runtime lookup * working variables with runtime lookup * delete rrddimvar and rrdfamily index * remove rrdsetvar; now all variables are in RRDVARs inside hosts and charts * added /api/v1/variable that resolves a variable the same way alerts do * remove rrdcalc from eval * remove debug code * remove duplicate assignment * Fix memory leak * all alert variables are now handled by alert_variable_lookup() and EVAL is now independent of alerts * hide all internal structures of EVAL * Enable -Wformat flag Signed-off-by: Tasos Katsoulas <tasos@netdata.cloud> * Adjust binding for calculation, warning, critical * Remove unused macro * Update config hash id * use the right info and summary in alerts log * use synchronous queries for alerts * Handle cases when config_hash_id is missing from health_log * remove deadlock from health worker * parsing to json payload for health alert prototypes * cleaner parsing and avoiding memory leaks in case of duplicate members in json * fix left-over rename of function * Keep original lookup field to send to the cloud Cleanup / rename function to store config Remove unused DEFINEs, functions * Use ac->lookup * link jobs to the host when the template is registered; do not accept running a function without a host * full dyncfg support for health alerts, except action TEST * working dyncfg additions, updates, removals * fixed missing source, wrong status updates * add alerts by type, component, classification, recipient and module at the /api/v2/alerts endpoint * fix dyncfg unittest * rename functions * generalize the json-c parser macros and move them to libnetdata * report progress when enabling and disabling dyncfg templates * moved rrdcalc and rrdvar to health * update alarms * added schema for alerts; separated alert_action_options from rrdr_options; restructured the json payload for alerts * enable parsed json alerts; allow sending back accepted but disabled * added format_version for alerts payload; enables/disables status now is also inheritted by the status of the rules; fixed variable names in json output * remove the RRDHOST pointer from DYNCFG * Fix command field submitted to the cloud * do not send updates to creation requests, for DYNCFG jobs --------- Signed-off-by: Tasos Katsoulas <tasos@netdata.cloud> Co-authored-by: Stelios Fragkakis <52996999+stelfrag@users.noreply.github.com> Co-authored-by: Tasos Katsoulas <tasos@netdata.cloud> Co-authored-by: ilyam8 <ilya@netdata.cloud>
47 lines
2.4 KiB
C
47 lines
2.4 KiB
C
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
#ifndef NETDATA_WEB_API_V1_H
|
|
#define NETDATA_WEB_API_V1_H 1
|
|
|
|
#include "web_api.h"
|
|
|
|
struct web_client;
|
|
|
|
CONTEXTS_V2_OPTIONS web_client_api_request_v2_context_options(char *o);
|
|
CONTEXTS_V2_ALERT_STATUS web_client_api_request_v2_alert_status(char *o);
|
|
void web_client_api_request_v2_contexts_options_to_buffer_json_array(BUFFER *wb, const char *key, CONTEXTS_V2_OPTIONS options);
|
|
void web_client_api_request_v2_contexts_alerts_status_to_buffer_json_array(BUFFER *wb, const char *key, CONTEXTS_V2_ALERT_STATUS options);
|
|
|
|
RRDR_OPTIONS rrdr_options_parse(char *o);
|
|
RRDR_OPTIONS rrdr_options_parse_one(const char *o);
|
|
|
|
void rrdr_options_to_buffer_json_array(BUFFER *wb, const char *key, RRDR_OPTIONS options);
|
|
void web_client_api_request_v1_data_options_to_string(char *buf, size_t size, RRDR_OPTIONS options);
|
|
|
|
uint32_t web_client_api_request_v1_data_format(char *name);
|
|
uint32_t web_client_api_request_v1_data_google_format(char *name);
|
|
|
|
int web_client_api_request_v1_alarms(RRDHOST *host, struct web_client *w, char *url);
|
|
int web_client_api_request_v1_alarms_values(RRDHOST *host, struct web_client *w, char *url);
|
|
int web_client_api_request_v1_alarm_log(RRDHOST *host, struct web_client *w, char *url);
|
|
int web_client_api_request_single_chart(RRDHOST *host, struct web_client *w, char *url, void callback(RRDSET *st, BUFFER *buf));
|
|
int web_client_api_request_v1_alarm_variables(RRDHOST *host, struct web_client *w, char *url);
|
|
int web_client_api_request_v1_alarm_count(RRDHOST *host, struct web_client *w, char *url);
|
|
int web_client_api_request_v1_charts(RRDHOST *host, struct web_client *w, char *url);
|
|
int web_client_api_request_v1_chart(RRDHOST *host, struct web_client *w, char *url);
|
|
int web_client_api_request_v1_registry(RRDHOST *host, struct web_client *w, char *url);
|
|
int web_client_api_request_v1_info(RRDHOST *host, struct web_client *w, char *url);
|
|
int web_client_api_request_v1(RRDHOST *host, struct web_client *w, char *url_path_endpoint);
|
|
int web_client_api_request_v1_info_fill_buffer(RRDHOST *host, BUFFER *wb);
|
|
|
|
void web_client_api_v1_init(void);
|
|
void web_client_api_v1_management_init(void);
|
|
|
|
void host_labels2json(RRDHOST *host, BUFFER *wb, const char *key);
|
|
void web_client_api_request_v1_info_summary_alarm_statuses(RRDHOST *host, BUFFER *wb, const char *key);
|
|
|
|
void web_client_source2buffer(struct web_client *w, BUFFER *source);
|
|
|
|
extern char *api_secret;
|
|
|
|
#endif //NETDATA_WEB_API_V1_H
|