summaryrefslogtreecommitdiffstats
path: root/aclk/schema-wrappers/alarm_config.h
blob: 157fbc60f0b2fe54db0ff38b565a718626ea49fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
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 */