summaryrefslogtreecommitdiffstats
path: root/plugins/check_dbi.d/config.h
diff options
context:
space:
mode:
authorLorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>2025-03-09 11:35:03 +0100
committerLorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>2025-03-09 11:35:03 +0100
commit95311d2e2c03d94f6bae0cacbac75fc1cd25b0e4 (patch)
tree960c12b0c7e87c508bcfcea2a99eec6fe34b03ee /plugins/check_dbi.d/config.h
parente3d2fccade397bbd6b318495192b4ca346becef0 (diff)
parent6dbc84f93595be81aee4de4ac3122b942047c22d (diff)
downloadmonitoring-plugins-95311d2e2c03d94f6bae0cacbac75fc1cd25b0e4.tar.gz
Merge branch 'master' into refactor/check_game
Diffstat (limited to 'plugins/check_dbi.d/config.h')
-rw-r--r--plugins/check_dbi.d/config.h63
1 files changed, 63 insertions, 0 deletions
diff --git a/plugins/check_dbi.d/config.h b/plugins/check_dbi.d/config.h
new file mode 100644
index 00000000..f6f0d7b3
--- /dev/null
+++ b/plugins/check_dbi.d/config.h
@@ -0,0 +1,63 @@
1#pragma once
2
3#include "../../config.h"
4#include <stddef.h>
5#include "../../lib/monitoringplug.h"
6
7typedef enum {
8 METRIC_CONN_TIME,
9 METRIC_SERVER_VERSION,
10 METRIC_QUERY_RESULT,
11 METRIC_QUERY_TIME,
12} mp_dbi_metric;
13
14typedef enum {
15 TYPE_NUMERIC,
16 TYPE_STRING,
17} mp_dbi_type;
18
19typedef struct {
20 char *key;
21 char *value;
22} driver_option_t;
23
24typedef struct {
25 char *dbi_driver;
26 char *host;
27 driver_option_t *dbi_options;
28 size_t dbi_options_num;
29 char *dbi_database;
30 char *dbi_query;
31
32 char *expect;
33 char *expect_re_str;
34 int expect_re_cflags;
35 mp_dbi_metric metric;
36 mp_dbi_type type;
37 char *warning_range;
38 char *critical_range;
39 thresholds *dbi_thresholds;
40
41} check_dbi_config;
42
43check_dbi_config check_dbi_config_init() {
44 check_dbi_config tmp = {
45 .dbi_driver = NULL,
46 .host = NULL,
47 .dbi_options = NULL,
48 .dbi_options_num = 0,
49 .dbi_database = NULL,
50 .dbi_query = NULL,
51
52 .expect = NULL,
53 .expect_re_str = NULL,
54 .expect_re_cflags = 0,
55 .metric = METRIC_QUERY_RESULT,
56 .type = TYPE_NUMERIC,
57
58 .warning_range = NULL,
59 .critical_range = NULL,
60 .dbi_thresholds = NULL,
61 };
62 return tmp;
63}