diff options
author | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2025-03-11 13:31:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-11 13:31:34 +0100 |
commit | 1ea66e0ae934d0c465d0f963c87667d080a63be9 (patch) | |
tree | 50fc00d98ce15654439a787907ccfd7860726598 /plugins/check_mysql.d | |
parent | eb31935abe12aee73178a1ce043f4979c885d158 (diff) | |
parent | 3143b5217cf1c71a085e6c4c7d22a5b699c4ff07 (diff) | |
download | monitoring-plugins-1ea66e0ae934d0c465d0f963c87667d080a63be9.tar.gz |
Merge pull request #2090 from RincewindsHat/refactor/check_mysql
Refactor check_mysql
Diffstat (limited to 'plugins/check_mysql.d')
-rw-r--r-- | plugins/check_mysql.d/config.h | 58 |
1 files changed, 58 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..71ddbe8d --- /dev/null +++ b/plugins/check_mysql.d/config.h | |||
@@ -0,0 +1,58 @@ | |||
1 | #pragma once | ||
2 | |||
3 | #include "../../config.h" | ||
4 | #include "thresholds.h" | ||
5 | #include <stddef.h> | ||
6 | #include <mysql.h> | ||
7 | |||
8 | typedef struct { | ||
9 | char *db_host; | ||
10 | unsigned int db_port; | ||
11 | char *db_user; | ||
12 | char *db_socket; | ||
13 | char *db_pass; | ||
14 | char *db; | ||
15 | char *ca_cert; | ||
16 | char *ca_dir; | ||
17 | char *cert; | ||
18 | char *key; | ||
19 | char *ciphers; | ||
20 | bool ssl; | ||
21 | char *opt_file; | ||
22 | char *opt_group; | ||
23 | |||
24 | bool check_replica; | ||
25 | bool ignore_auth; | ||
26 | |||
27 | double warning_time; | ||
28 | double critical_time; | ||
29 | thresholds *my_threshold; | ||
30 | |||
31 | } check_mysql_config; | ||
32 | |||
33 | check_mysql_config check_mysql_config_init() { | ||
34 | check_mysql_config tmp = { | ||
35 | .db_host = NULL, | ||
36 | .db_port = MYSQL_PORT, | ||
37 | .db = NULL, | ||
38 | .db_pass = NULL, | ||
39 | .db_socket = NULL, | ||
40 | .db_user = NULL, | ||
41 | .ca_cert = NULL, | ||
42 | .ca_dir = NULL, | ||
43 | .cert = NULL, | ||
44 | .key = NULL, | ||
45 | .ciphers = NULL, | ||
46 | .ssl = false, | ||
47 | .opt_file = NULL, | ||
48 | .opt_group = NULL, | ||
49 | |||
50 | .check_replica = false, | ||
51 | .ignore_auth = false, | ||
52 | |||
53 | .warning_time = 0, | ||
54 | .critical_time = 0, | ||
55 | .my_threshold = NULL, | ||
56 | }; | ||
57 | return tmp; | ||
58 | } | ||