summaryrefslogtreecommitdiffstats
path: root/aclk/schema-wrappers/alarm_config.h
diff options
context:
space:
mode:
authorTimotej S <6674623+underhood@users.noreply.github.com>2021-08-27 08:26:10 +0200
committerGitHub <noreply@github.com>2021-08-27 08:26:10 +0200
commit96cac58ec8307a7088a4abc90e3ba6c1553745a1 (patch)
treef743d442d08f1d6fc95aa426f269a90bf790a757 /aclk/schema-wrappers/alarm_config.h
parent2ef8442d850b5e631befcaac2ff5ef78a22284e1 (diff)
Adds Alert Related API for new protocol (#11424)
* adds alarm related message generators, parsers and API for the new protocol
Diffstat (limited to 'aclk/schema-wrappers/alarm_config.h')
-rw-r--r--aclk/schema-wrappers/alarm_config.h69
1 files changed, 69 insertions, 0 deletions
diff --git a/aclk/schema-wrappers/alarm_config.h b/aclk/schema-wrappers/alarm_config.h
new file mode 100644
index 0000000000..157fbc60f0
--- /dev/null
+++ b/aclk/schema-wrappers/alarm_config.h
@@ -0,0 +1,69 @@
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#ifndef ACLK_SCHEMA_WRAPPER_ALARM_CONFIG_H
+#define ACLK_SCHEMA_WRAPPER_ALARM_CONFIG_H
+
+#include <stdlib.h>
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct aclk_alarm_configuration {
+ char *alarm;
+ char *tmpl;
+ char *on_chart;
+
+ char *classification;
+ char *type;
+ char *component;
+
+ char *os;
+ char *hosts;
+ char *plugin;
+ char *module;
+ char *charts;
+ char *families;
+ char *lookup;
+ char *every;
+ char *units;
+
+ char *green;
+ char *red;
+
+ char *calculation_expr;
+ char *warning_expr;
+ char *critical_expr;
+
+ char *recipient;
+ char *exec;
+ char *delay;
+ char *repeat;
+ char *info;
+ char *options;
+ char *host_labels;
+
+ int32_t p_db_lookup_after;
+ int32_t p_db_lookup_before;
+ char *p_db_lookup_dimensions;
+ char *p_db_lookup_method;
+ char *p_db_lookup_options;
+ int32_t p_update_every;
+};
+
+void destroy_aclk_alarm_configuration(struct aclk_alarm_configuration *cfg);
+
+struct provide_alarm_configuration {
+ char *cfg_hash;
+ struct aclk_alarm_configuration cfg;
+};
+
+char *generate_provide_alarm_configuration(size_t *len, struct provide_alarm_configuration *data);
+char *parse_send_alarm_configuration(const char *data, size_t len);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* ACLK_SCHEMA_WRAPPER_ALARM_CONFIG_H */