| 1 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | |
| 3 | #ifndef ACLK_SCHEMA_WRAPPER_ALARM_CONFIG_H |
| 4 | #define ACLK_SCHEMA_WRAPPER_ALARM_CONFIG_H |
| 5 | |
| 6 | #include <stdlib.h> |
| 7 | #include <stdint.h> |
| 8 | |
| 9 | #ifdef __cplusplus |
| 10 | extern "C" { |
| 11 | #endif |
| 12 | |
| 13 | struct aclk_alarm_configuration { |
| 14 | char *alarm; |
| 15 | char *tmpl; |
| 16 | char *on_chart; |
| 17 | |
| 18 | char *classification; |
| 19 | char *type; |
| 20 | char *component; |
| 21 | |
| 22 | char *os; |
| 23 | char *hosts; |
| 24 | char *plugin; |
| 25 | char *module; |
| 26 | char *charts; |
| 27 | char *lookup; |
| 28 | char *every; |
| 29 | char *units; |
| 30 | |
| 31 | char *green; |
| 32 | char *red; |
| 33 | |
| 34 | char *calculation_expr; |
| 35 | char *warning_expr; |
| 36 | char *critical_expr; |
| 37 | |
| 38 | char *recipient; |
| 39 | char *exec; |
| 40 | char *delay; |
| 41 | char *repeat; |
| 42 | char *info; |
| 43 | char *options; |
| 44 | char *host_labels; |
| 45 | |
| 46 | int32_t p_db_lookup_after; |
| 47 | int32_t p_db_lookup_before; |
| 48 | char *p_db_lookup_dimensions; |
| 49 | char *p_db_lookup_method; |
| 50 | char *p_db_lookup_options; |
| 51 | int32_t p_update_every; |
| 52 | |
| 53 | char *chart_labels; |
| 54 | char *summary; |
| 55 | }; |
| 56 | |
| 57 | void destroy_aclk_alarm_configuration(struct aclk_alarm_configuration *cfg); |
| 58 | |
| 59 | struct provide_alarm_configuration { |
| 60 | char *cfg_hash; |
| 61 | struct aclk_alarm_configuration cfg; |
| 62 | }; |
| 63 | |
| 64 | char *generate_provide_alarm_configuration(size_t *len, struct provide_alarm_configuration *data); |
| 65 | char *parse_send_alarm_configuration(const char *data, size_t len); |
| 66 | |
| 67 | #ifdef __cplusplus |
| 68 | } |
| 69 | #endif |
| 70 | |
| 71 | #endif /* ACLK_SCHEMA_WRAPPER_ALARM_CONFIG_H */ |