diff options
Diffstat (limited to 'plugins/check_mysql.d/config.h')
| -rw-r--r-- | plugins/check_mysql.d/config.h | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/plugins/check_mysql.d/config.h b/plugins/check_mysql.d/config.h new file mode 100644 index 00000000..1d8c82bb --- /dev/null +++ b/plugins/check_mysql.d/config.h | |||
| @@ -0,0 +1,59 @@ | |||
| 1 | #pragma once | ||
| 2 | |||
| 3 | #include "../../config.h" | ||
| 4 | #include "output.h" | ||
| 5 | #include "thresholds.h" | ||
| 6 | #include <stddef.h> | ||
| 7 | #include <mysql.h> | ||
| 8 | |||
| 9 | typedef struct { | ||
| 10 | char *db_host; | ||
| 11 | unsigned int db_port; | ||
| 12 | char *db_user; | ||
| 13 | char *db_socket; | ||
| 14 | char *db_pass; | ||
| 15 | char *db; | ||
| 16 | char *ca_cert; | ||
| 17 | char *ca_dir; | ||
| 18 | char *cert; | ||
| 19 | char *key; | ||
| 20 | char *ciphers; | ||
| 21 | bool ssl; | ||
| 22 | char *opt_file; | ||
| 23 | char *opt_group; | ||
| 24 | |||
| 25 | bool check_replica; | ||
| 26 | bool ignore_auth; | ||
| 27 | |||
| 28 | mp_thresholds replica_thresholds; | ||
| 29 | |||
| 30 | bool output_format_is_set; | ||
| 31 | mp_output_format output_format; | ||
| 32 | } check_mysql_config; | ||
| 33 | |||
| 34 | check_mysql_config check_mysql_config_init() { | ||
| 35 | check_mysql_config tmp = { | ||
| 36 | .db_host = NULL, | ||
| 37 | .db_port = MYSQL_PORT, | ||
| 38 | .db = NULL, | ||
| 39 | .db_pass = NULL, | ||
| 40 | .db_socket = NULL, | ||
| 41 | .db_user = NULL, | ||
| 42 | .ca_cert = NULL, | ||
| 43 | .ca_dir = NULL, | ||
| 44 | .cert = NULL, | ||
| 45 | .key = NULL, | ||
| 46 | .ciphers = NULL, | ||
| 47 | .ssl = false, | ||
| 48 | .opt_file = NULL, | ||
| 49 | .opt_group = NULL, | ||
| 50 | |||
| 51 | .check_replica = false, | ||
| 52 | .ignore_auth = false, | ||
| 53 | |||
| 54 | .replica_thresholds = mp_thresholds_init(), | ||
| 55 | |||
| 56 | .output_format_is_set = false, | ||
| 57 | }; | ||
| 58 | return tmp; | ||
| 59 | } | ||
