diff options
Diffstat (limited to 'plugins/check_dbi.d')
| -rw-r--r-- | plugins/check_dbi.d/config.h | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/plugins/check_dbi.d/config.h b/plugins/check_dbi.d/config.h index 09aa67da..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 | ||
| 7 | typedef enum { | 8 | typedef 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 | ||
| 14 | typedef enum { | 15 | typedef enum { |
| 15 | TYPE_NUMERIC, | 16 | TYPE_NUMERIC, |
| 16 | TYPE_STRING, | 17 | TYPE_STRING, |
| 17 | } mp_dbi_type; | 18 | } check_dbi_type; |
| 18 | 19 | ||
| 19 | typedef struct { | 20 | typedef struct { |
| 20 | char *key; | 21 | char *key; |
| @@ -24,19 +25,19 @@ typedef struct { | |||
| 24 | typedef struct { | 25 | typedef 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 | ||
| 41 | bool output_format_is_set; | 42 | bool output_format_is_set; |
| 42 | mp_output_format output_format; | 43 | mp_output_format output_format; |
| @@ -48,8 +49,8 @@ check_dbi_config check_dbi_config_init() { | |||
| 48 | .host = NULL, | 49 | .host = NULL, |
| 49 | .dbi_options = NULL, | 50 | .dbi_options = NULL, |
| 50 | .dbi_options_num = 0, | 51 | .dbi_options_num = 0, |
| 51 | .dbi_database = NULL, | 52 | .database = NULL, |
| 52 | .dbi_query = NULL, | 53 | .query = NULL, |
| 53 | 54 | ||
| 54 | .expect = NULL, | 55 | .expect = NULL, |
| 55 | .expect_re_str = NULL, | 56 | .expect_re_str = NULL, |
| @@ -57,9 +58,7 @@ check_dbi_config check_dbi_config_init() { | |||
| 57 | .metric = METRIC_QUERY_RESULT, | 58 | .metric = METRIC_QUERY_RESULT, |
| 58 | .type = TYPE_NUMERIC, | 59 | .type = TYPE_NUMERIC, |
| 59 | 60 | ||
| 60 | .warning_range = NULL, | 61 | .thresholds = mp_thresholds_init(), |
| 61 | .critical_range = NULL, | ||
| 62 | .dbi_thresholds = NULL, | ||
| 63 | 62 | ||
| 64 | .output_format_is_set = false, | 63 | .output_format_is_set = false, |
| 65 | }; | 64 | }; |
