diff options
Diffstat (limited to '')
-rw-r--r-- | aclk/schema-wrappers/alarm_config.cc | 18 | ||||
-rw-r--r-- | aclk/schema-wrappers/alarm_config.h | 2 | ||||
-rw-r--r-- | aclk/schema-wrappers/alarm_stream.cc | 22 | ||||
-rw-r--r-- | aclk/schema-wrappers/alarm_stream.h | 3 | ||||
-rw-r--r-- | aclk/schema-wrappers/node_info.h | 2 | ||||
-rw-r--r-- | aclk/schema-wrappers/schema_wrapper_utils.cc | 4 |
6 files changed, 11 insertions, 40 deletions
diff --git a/aclk/schema-wrappers/alarm_config.cc b/aclk/schema-wrappers/alarm_config.cc index fe0b0517c..64d28f324 100644 --- a/aclk/schema-wrappers/alarm_config.cc +++ b/aclk/schema-wrappers/alarm_config.cc @@ -15,28 +15,22 @@ void destroy_aclk_alarm_configuration(struct aclk_alarm_configuration *cfg) freez(cfg->alarm); freez(cfg->tmpl); freez(cfg->on_chart); - freez(cfg->classification); freez(cfg->type); freez(cfg->component); - freez(cfg->os); freez(cfg->hosts); freez(cfg->plugin); freez(cfg->module); freez(cfg->charts); - freez(cfg->families); freez(cfg->lookup); freez(cfg->every); freez(cfg->units); - freez(cfg->green); freez(cfg->red); - freez(cfg->calculation_expr); freez(cfg->warning_expr); freez(cfg->critical_expr); - freez(cfg->recipient); freez(cfg->exec); freez(cfg->delay); @@ -44,12 +38,11 @@ void destroy_aclk_alarm_configuration(struct aclk_alarm_configuration *cfg) freez(cfg->info); freez(cfg->options); freez(cfg->host_labels); - freez(cfg->p_db_lookup_dimensions); freez(cfg->p_db_lookup_method); freez(cfg->p_db_lookup_options); - freez(cfg->chart_labels); + freez(cfg->summary); } char *generate_provide_alarm_configuration(size_t *len, struct provide_alarm_configuration *data) @@ -65,14 +58,12 @@ char *generate_provide_alarm_configuration(size_t *len, struct provide_alarm_con cfg->set_template_(data->cfg.tmpl); if(data->cfg.on_chart) cfg->set_on_chart(data->cfg.on_chart); - if (data->cfg.classification) cfg->set_classification(data->cfg.classification); if (data->cfg.type) cfg->set_type(data->cfg.type); if (data->cfg.component) cfg->set_component(data->cfg.component); - if (data->cfg.os) cfg->set_os(data->cfg.os); if (data->cfg.hosts) @@ -83,27 +74,22 @@ char *generate_provide_alarm_configuration(size_t *len, struct provide_alarm_con cfg->set_module(data->cfg.module); if(data->cfg.charts) cfg->set_charts(data->cfg.charts); - if(data->cfg.families) - cfg->set_families(data->cfg.families); if(data->cfg.lookup) cfg->set_lookup(data->cfg.lookup); if(data->cfg.every) cfg->set_every(data->cfg.every); if(data->cfg.units) cfg->set_units(data->cfg.units); - if (data->cfg.green) cfg->set_green(data->cfg.green); if (data->cfg.red) cfg->set_red(data->cfg.red); - if (data->cfg.calculation_expr) cfg->set_calculation_expr(data->cfg.calculation_expr); if (data->cfg.warning_expr) cfg->set_warning_expr(data->cfg.warning_expr); if (data->cfg.critical_expr) cfg->set_critical_expr(data->cfg.critical_expr); - if (data->cfg.recipient) cfg->set_recipient(data->cfg.recipient); if (data->cfg.exec) @@ -131,6 +117,8 @@ char *generate_provide_alarm_configuration(size_t *len, struct provide_alarm_con if (data->cfg.chart_labels) cfg->set_chart_labels(data->cfg.chart_labels); + if (data->cfg.summary) + cfg->set_summary(data->cfg.summary); *len = PROTO_COMPAT_MSG_SIZE(msg); char *bin = (char*)mallocz(*len); diff --git a/aclk/schema-wrappers/alarm_config.h b/aclk/schema-wrappers/alarm_config.h index 4eaa4fd70..3c9a5d9a8 100644 --- a/aclk/schema-wrappers/alarm_config.h +++ b/aclk/schema-wrappers/alarm_config.h @@ -24,7 +24,6 @@ struct aclk_alarm_configuration { char *plugin; char *module; char *charts; - char *families; char *lookup; char *every; char *units; @@ -52,6 +51,7 @@ struct aclk_alarm_configuration { int32_t p_update_every; char *chart_labels; + char *summary; }; void destroy_aclk_alarm_configuration(struct aclk_alarm_configuration *cfg); diff --git a/aclk/schema-wrappers/alarm_stream.cc b/aclk/schema-wrappers/alarm_stream.cc index 1538bc9e0..29d80e39e 100644 --- a/aclk/schema-wrappers/alarm_stream.cc +++ b/aclk/schema-wrappers/alarm_stream.cc @@ -66,60 +66,41 @@ static alarms::v1::AlarmStatus aclk_alarm_status_to_proto(enum aclk_alarm_status void destroy_alarm_log_entry(struct alarm_log_entry *entry) { - //freez(entry->node_id); - //freez(entry->claim_id); - freez(entry->chart); freez(entry->name); - freez(entry->family); - freez(entry->config_hash); - freez(entry->timezone); - freez(entry->exec_path); freez(entry->conf_source); freez(entry->command); - freez(entry->value_string); freez(entry->old_value_string); - freez(entry->rendered_info); freez(entry->chart_context); freez(entry->transition_id); freez(entry->chart_name); + freez(entry->summary); } static void fill_alarm_log_entry(struct alarm_log_entry *data, AlarmLogEntry *proto) { proto->set_node_id(data->node_id); proto->set_claim_id(data->claim_id); - proto->set_chart(data->chart); proto->set_name(data->name); - if (data->family) - proto->set_family(data->family); - proto->set_when(data->when); - proto->set_config_hash(data->config_hash); - proto->set_utc_offset(data->utc_offset); proto->set_timezone(data->timezone); - proto->set_exec_path(data->exec_path); proto->set_conf_source(data->conf_source); proto->set_command(data->command); - proto->set_duration(data->duration); proto->set_non_clear_duration(data->non_clear_duration); - - proto->set_status(aclk_alarm_status_to_proto(data->status)); proto->set_old_status(aclk_alarm_status_to_proto(data->old_status)); proto->set_delay(data->delay); proto->set_delay_up_to_timestamp(data->delay_up_to_timestamp); - proto->set_last_repeat(data->last_repeat); proto->set_silenced(data->silenced); @@ -136,6 +117,7 @@ static void fill_alarm_log_entry(struct alarm_log_entry *data, AlarmLogEntry *pr proto->set_event_id(data->event_id); proto->set_transition_id(data->transition_id); proto->set_chart_name(data->chart_name); + proto->set_summary(data->summary); } char *generate_alarm_log_entry(size_t *len, struct alarm_log_entry *data) diff --git a/aclk/schema-wrappers/alarm_stream.h b/aclk/schema-wrappers/alarm_stream.h index 87893e0db..3c81ff445 100644 --- a/aclk/schema-wrappers/alarm_stream.h +++ b/aclk/schema-wrappers/alarm_stream.h @@ -76,7 +76,8 @@ struct alarm_log_entry { char *chart_name; uint64_t event_id; - char *transition_id; + char *transition_id; + char *summary; }; struct send_alarm_checkpoint { diff --git a/aclk/schema-wrappers/node_info.h b/aclk/schema-wrappers/node_info.h index de4ade78a..4f57601df 100644 --- a/aclk/schema-wrappers/node_info.h +++ b/aclk/schema-wrappers/node_info.h @@ -39,7 +39,7 @@ struct aclk_node_info { const char *custom_info; const char *machine_guid; - DICTIONARY *host_labels_ptr; + RRDLABELS *host_labels_ptr; struct machine_learning_info ml_info; }; diff --git a/aclk/schema-wrappers/schema_wrapper_utils.cc b/aclk/schema-wrappers/schema_wrapper_utils.cc index 6573e6299..96a4b9bf1 100644 --- a/aclk/schema-wrappers/schema_wrapper_utils.cc +++ b/aclk/schema-wrappers/schema_wrapper_utils.cc @@ -14,8 +14,8 @@ void set_timeval_from_google_timestamp(const google::protobuf::Timestamp &ts, st tv->tv_usec = ts.nanos()/1000; } -int label_add_to_map_callback(const char *name, const char *value, RRDLABEL_SRC ls, void *data) { - (void)ls; +int label_add_to_map_callback(const char *name, const char *value, RRDLABEL_SRC ls __maybe_unused, void *data) +{ auto map = (google::protobuf::Map<std::string, std::string> *)data; map->insert({name, value}); return 1; |