summaryrefslogtreecommitdiffstats
path: root/plugins/check_dbi.d/config.h
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/check_dbi.d/config.h')
-rw-r--r--plugins/check_dbi.d/config.h31
1 files changed, 17 insertions, 14 deletions
diff --git a/plugins/check_dbi.d/config.h b/plugins/check_dbi.d/config.h
index f6f0d7b3..25d74a12 100644
--- a/plugins/check_dbi.d/config.h
+++ b/plugins/check_dbi.d/config.h
@@ -3,18 +3,19 @@
3#include "../../config.h" 3#include "../../config.h"
4#include <stddef.h> 4#include <stddef.h>
5#include "../../lib/monitoringplug.h" 5#include "../../lib/monitoringplug.h"
6#include "thresholds.h"
6 7
7typedef enum { 8typedef enum {
8 METRIC_CONN_TIME, 9 METRIC_CONN_TIME,
9 METRIC_SERVER_VERSION, 10 METRIC_SERVER_VERSION,
10 METRIC_QUERY_RESULT, 11 METRIC_QUERY_RESULT,
11 METRIC_QUERY_TIME, 12 METRIC_QUERY_TIME,
12} mp_dbi_metric; 13} check_dbi_metric;
13 14
14typedef enum { 15typedef enum {
15 TYPE_NUMERIC, 16 TYPE_NUMERIC,
16 TYPE_STRING, 17 TYPE_STRING,
17} mp_dbi_type; 18} check_dbi_type;
18 19
19typedef struct { 20typedef struct {
20 char *key; 21 char *key;
@@ -24,20 +25,22 @@ typedef struct {
24typedef struct { 25typedef struct {
25 char *dbi_driver; 26 char *dbi_driver;
26 char *host; 27 char *host;
28
27 driver_option_t *dbi_options; 29 driver_option_t *dbi_options;
28 size_t dbi_options_num; 30 size_t dbi_options_num;
29 char *dbi_database; 31
30 char *dbi_query; 32 char *database;
33 char *query;
31 34
32 char *expect; 35 char *expect;
33 char *expect_re_str; 36 char *expect_re_str;
34 int expect_re_cflags; 37 int expect_re_cflags;
35 mp_dbi_metric metric; 38 check_dbi_metric metric;
36 mp_dbi_type type; 39 check_dbi_type type;
37 char *warning_range; 40 mp_thresholds thresholds;
38 char *critical_range;
39 thresholds *dbi_thresholds;
40 41
42 bool output_format_is_set;
43 mp_output_format output_format;
41} check_dbi_config; 44} check_dbi_config;
42 45
43check_dbi_config check_dbi_config_init() { 46check_dbi_config check_dbi_config_init() {
@@ -46,8 +49,8 @@ check_dbi_config check_dbi_config_init() {
46 .host = NULL, 49 .host = NULL,
47 .dbi_options = NULL, 50 .dbi_options = NULL,
48 .dbi_options_num = 0, 51 .dbi_options_num = 0,
49 .dbi_database = NULL, 52 .database = NULL,
50 .dbi_query = NULL, 53 .query = NULL,
51 54
52 .expect = NULL, 55 .expect = NULL,
53 .expect_re_str = NULL, 56 .expect_re_str = NULL,
@@ -55,9 +58,9 @@ check_dbi_config check_dbi_config_init() {
55 .metric = METRIC_QUERY_RESULT, 58 .metric = METRIC_QUERY_RESULT,
56 .type = TYPE_NUMERIC, 59 .type = TYPE_NUMERIC,
57 60
58 .warning_range = NULL, 61 .thresholds = mp_thresholds_init(),
59 .critical_range = NULL, 62
60 .dbi_thresholds = NULL, 63 .output_format_is_set = false,
61 }; 64 };
62 return tmp; 65 return tmp;
63} 66}