summaryrefslogtreecommitdiffstats
path: root/plugins/check_mysql.d/config.h
blob: ef086cfc2104c74241c57644012d43f554c2a3be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#pragma once

#include "../../config.h"
#include "thresholds.h"
#include <stddef.h>
#include <mysql.h>

typedef struct {
	char *db_host;
	unsigned int db_port;
	char *db_user;
	char *db_socket;
	char *db_pass;
	char *db;
	char *ca_cert;
	char *ca_dir;
	char *cert;
	char *key;
	char *ciphers;
	bool ssl;
	char *opt_file;
	char *opt_group;

	bool check_replica;
	bool ignore_auth;

	mp_thresholds replica_thresholds;

} check_mysql_config;

check_mysql_config check_mysql_config_init() {
	check_mysql_config tmp = {
		.db_host = NULL,
		.db_port = MYSQL_PORT,
		.db = NULL,
		.db_pass = NULL,
		.db_socket = NULL,
		.db_user = NULL,
		.ca_cert = NULL,
		.ca_dir = NULL,
		.cert = NULL,
		.key = NULL,
		.ciphers = NULL,
		.ssl = false,
		.opt_file = NULL,
		.opt_group = NULL,

		.check_replica = false,
		.ignore_auth = false,

		.replica_thresholds = mp_thresholds_init(),
	};
	return tmp;
}