diff options
| author | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2025-03-11 12:55:36 +0100 |
|---|---|---|
| committer | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2025-03-11 12:55:36 +0100 |
| commit | 67e41f1d57da40b6407da5434017d86abb7ae3bb (patch) | |
| tree | 2228a152b13ca14635717d8a10df6280f2345a49 /plugins/check_ldap.d | |
| parent | 94f81f6fc78003d4f6f7d75789e3c4b364747d8b (diff) | |
| parent | d087a8820e03ad0b5aef0a904eb417aaca0699cb (diff) | |
| download | monitoring-plugins-67e41f1d.tar.gz | |
Merge branch 'master' into refactor/check_mrtgraf
Diffstat (limited to 'plugins/check_ldap.d')
| -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 | } | ||
