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