summaryrefslogtreecommitdiffstats
path: root/plugins/check_ldap.d/config.h
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/check_ldap.d/config.h')
-rw-r--r--plugins/check_ldap.d/config.h61
1 files changed, 61 insertions, 0 deletions
diff --git a/plugins/check_ldap.d/config.h b/plugins/check_ldap.d/config.h
new file mode 100644
index 00000000..97a9cfa7
--- /dev/null
+++ b/plugins/check_ldap.d/config.h
@@ -0,0 +1,61 @@
1#pragma once
2
3#include "../../config.h"
4#include "thresholds.h"
5#include <mysql/udf_registration_types.h>
6#include <stddef.h>
7
8static char ld_defattr[] = "(objectclass=*)";
9
10enum {
11#ifdef HAVE_LDAP_SET_OPTION
12 DEFAULT_PROTOCOL = 2,
13#endif
14};
15
16typedef struct {
17 char *ld_host;
18 char *ld_base;
19 char *ld_passwd;
20 char *ld_binddn;
21 char *ld_attr;
22 int ld_port;
23 bool starttls;
24 bool ssl_on_connect;
25#ifdef HAVE_LDAP_SET_OPTION
26 int ld_protocol;
27#endif
28
29 char *warn_entries;
30 char *crit_entries;
31 thresholds *entries_thresholds;
32 bool warn_time_set;
33 double warn_time;
34 bool crit_time_set;
35 double crit_time;
36} check_ldap_config;
37
38check_ldap_config check_ldap_config_init() {
39 check_ldap_config tmp = {
40 .ld_host = NULL,
41 .ld_base = NULL,
42 .ld_passwd = NULL,
43 .ld_binddn = NULL,
44 .ld_attr = ld_defattr,
45 .ld_port = -1,
46 .starttls = false,
47 .ssl_on_connect = false,
48#ifdef HAVE_LDAP_SET_OPTION
49 .ld_protocol = DEFAULT_PROTOCOL,
50#endif
51
52 .warn_entries = NULL,
53 .crit_entries = NULL,
54 .entries_thresholds = NULL,
55 .warn_time_set = false,
56 .warn_time = 0,
57 .crit_time_set = false,
58 .crit_time = 0,
59 };
60 return tmp;
61}