From 07d3eb9e2c729b6ab5effc0f664b6d5d9958fa72 Mon Sep 17 00:00:00 2001 From: Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> Date: Tue, 25 Nov 2025 12:31:00 +0100 Subject: check_ldap: modern output implementation --- plugins/check_ldap.c | 310 ++++++++++++++++++++++++++++++++------------------- 1 file changed, 196 insertions(+), 114 deletions(-) (limited to 'plugins/check_ldap.c') diff --git a/plugins/check_ldap.c b/plugins/check_ldap.c index 77a33304..f1380be4 100644 --- a/plugins/check_ldap.c +++ b/plugins/check_ldap.c @@ -27,12 +27,11 @@ *****************************************************************************/ /* progname may be check_ldaps */ -char *progname = "check_ldap"; -const char *copyright = "2000-2024"; -const char *email = "devel@monitoring-plugins.org"; - +#include "output.h" #include "common.h" #include "netutils.h" +#include "perfdata.h" +#include "thresholds.h" #include "utils.h" #include "check_ldap.d/config.h" @@ -41,6 +40,10 @@ const char *email = "devel@monitoring-plugins.org"; #define LDAP_DEPRECATED 1 #include +char *progname = "check_ldap"; +const char *copyright = "2000-2024"; +const char *email = "devel@monitoring-plugins.org"; + enum { DEFAULT_PORT = 389 }; @@ -89,101 +92,172 @@ int main(int argc, char *argv[]) { struct timeval start_time; gettimeofday(&start_time, NULL); + mp_check overall = mp_check_init(); + LDAP *ldap_connection; /* initialize ldap */ + { #ifdef HAVE_LDAP_INIT - if (!(ldap_connection = ldap_init(config.ld_host, config.ld_port))) { - printf("Could not connect to the server at port %i\n", config.ld_port); - return STATE_CRITICAL; - } + mp_subcheck sc_ldap_init = mp_subcheck_init(); + if (!(ldap_connection = ldap_init(config.ld_host, config.ld_port))) { + xasprintf(&sc_ldap_init.output, "could not connect to the server at port %i", + config.ld_port); + sc_ldap_init = mp_set_subcheck_state(sc_ldap_init, STATE_CRITICAL); + mp_add_subcheck_to_check(&overall, sc_ldap_init); + mp_exit(overall); + } else { + xasprintf(&sc_ldap_init.output, "connected to the server at port %i", config.ld_port); + sc_ldap_init = mp_set_subcheck_state(sc_ldap_init, STATE_OK); + mp_add_subcheck_to_check(&overall, sc_ldap_init); + } #else - if (!(ld = ldap_open(config.ld_host, config.ld_port))) { - if (verbose) { - ldap_perror(ldap_connection, "ldap_open"); + mp_subcheck sc_ldap_init = mp_subcheck_init(); + if (!(ld = ldap_open(config.ld_host, config.ld_port))) { + if (verbose) { + ldap_perror(ldap_connection, "ldap_open"); + } + xasprintf(&sc_ldap_init.output, "Could not connect to the server at port %i"), config.ld_port); + sc_ldap_init = mp_set_subcheck_state(sc_ldap_init, STATE_CRITICAL); + mp_add_subcheck_to_check(&overall, sc_ldap_init); + mp_exit(overall); + } else { + xasprintf(&sc_ldap_init.output, "connected to the server at port %i", config.ld_port); + sc_ldap_init = mp_set_subcheck_state(sc_ldap_init, STATE_OK); + mp_add_subcheck_to_check(&overall, sc_ldap_init); } - printf(_("Could not connect to the server at port %i\n"), config.ld_port); - return STATE_CRITICAL; - } #endif /* HAVE_LDAP_INIT */ + } #ifdef HAVE_LDAP_SET_OPTION /* set ldap options */ + mp_subcheck sc_ldap_set_opts = mp_subcheck_init(); if (ldap_set_option(ldap_connection, LDAP_OPT_PROTOCOL_VERSION, &config.ld_protocol) != LDAP_OPT_SUCCESS) { - printf(_("Could not set protocol version %d\n"), config.ld_protocol); - return STATE_CRITICAL; + xasprintf(&sc_ldap_set_opts.output, "Could not set protocol version %d", + config.ld_protocol); + sc_ldap_set_opts = mp_set_subcheck_state(sc_ldap_set_opts, STATE_CRITICAL); + mp_add_subcheck_to_check(&overall, sc_ldap_set_opts); + mp_exit(overall); + } else { + xasprintf(&sc_ldap_set_opts.output, "set protocol version %d", config.ld_protocol); + sc_ldap_set_opts = mp_set_subcheck_state(sc_ldap_set_opts, STATE_OK); + mp_add_subcheck_to_check(&overall, sc_ldap_set_opts); } #endif int version = 3; int tls; - if (config.ld_port == LDAPS_PORT || config.ssl_on_connect) { + { + if (config.ld_port == LDAPS_PORT || config.ssl_on_connect) { #if defined(HAVE_LDAP_SET_OPTION) && defined(LDAP_OPT_X_TLS) - /* ldaps: set option tls */ - tls = LDAP_OPT_X_TLS_HARD; + /* ldaps: set option tls */ + tls = LDAP_OPT_X_TLS_HARD; - if (ldap_set_option(ldap_connection, LDAP_OPT_X_TLS, &tls) != LDAP_SUCCESS) { - if (verbose) { - ldap_perror(ldap_connection, "ldaps_option"); + mp_subcheck sc_ldap_tls_init = mp_subcheck_init(); + if (ldap_set_option(ldap_connection, LDAP_OPT_X_TLS, &tls) != LDAP_SUCCESS) { + if (verbose) { + ldap_perror(ldap_connection, "ldaps_option"); + } + xasprintf(&sc_ldap_tls_init.output, "could not init TLS at port %i!", + config.ld_port); + sc_ldap_tls_init = mp_set_subcheck_state(sc_ldap_tls_init, STATE_CRITICAL); + mp_add_subcheck_to_check(&overall, sc_ldap_tls_init); + mp_exit(overall); + } else { + xasprintf(&sc_ldap_tls_init.output, "initiated TLS at port %i!", config.ld_port); + sc_ldap_tls_init = mp_set_subcheck_state(sc_ldap_tls_init, STATE_OK); + mp_add_subcheck_to_check(&overall, sc_ldap_tls_init); } - printf(_("Could not init TLS at port %i!\n"), config.ld_port); - return STATE_CRITICAL; - } #else - printf(_("TLS not supported by the libraries!\n")); - return STATE_CRITICAL; + printf(_("TLS not supported by the libraries!\n")); + exit(STATE_CRITICAL); #endif /* LDAP_OPT_X_TLS */ - } else if (config.starttls) { + } else if (config.starttls) { #if defined(HAVE_LDAP_SET_OPTION) && defined(HAVE_LDAP_START_TLS_S) - /* ldap with startTLS: set option version */ - if (ldap_get_option(ldap_connection, LDAP_OPT_PROTOCOL_VERSION, &version) == - LDAP_OPT_SUCCESS) { - if (version < LDAP_VERSION3) { - version = LDAP_VERSION3; - ldap_set_option(ldap_connection, LDAP_OPT_PROTOCOL_VERSION, &version); + /* ldap with startTLS: set option version */ + if (ldap_get_option(ldap_connection, LDAP_OPT_PROTOCOL_VERSION, &version) == + LDAP_OPT_SUCCESS) { + if (version < LDAP_VERSION3) { + version = LDAP_VERSION3; + ldap_set_option(ldap_connection, LDAP_OPT_PROTOCOL_VERSION, &version); + } } - } - /* call start_tls */ - if (ldap_start_tls_s(ldap_connection, NULL, NULL) != LDAP_SUCCESS) { - if (verbose) { - ldap_perror(ldap_connection, "ldap_start_tls"); + /* call start_tls */ + mp_subcheck sc_ldap_starttls = mp_subcheck_init(); + if (ldap_start_tls_s(ldap_connection, NULL, NULL) != LDAP_SUCCESS) { + if (verbose) { + ldap_perror(ldap_connection, "ldap_start_tls"); + } + xasprintf(&sc_ldap_starttls.output, "could not init STARTTLS at port %i!", + config.ld_port); + sc_ldap_starttls = mp_set_subcheck_state(sc_ldap_starttls, STATE_CRITICAL); + mp_add_subcheck_to_check(&overall, sc_ldap_starttls); + mp_exit(overall); + } else { + xasprintf(&sc_ldap_starttls.output, "initiated STARTTLS at port %i!", + config.ld_port); + sc_ldap_starttls = mp_set_subcheck_state(sc_ldap_starttls, STATE_OK); + mp_add_subcheck_to_check(&overall, sc_ldap_starttls); } - printf(_("Could not init startTLS at port %i!\n"), config.ld_port); - return STATE_CRITICAL; - } #else - printf(_("startTLS not supported by the library, needs LDAPv3!\n")); - return STATE_CRITICAL; + printf(_("startTLS not supported by the library, needs LDAPv3!\n")); + exit(STATE_CRITICAL); #endif /* HAVE_LDAP_START_TLS_S */ + } } /* bind to the ldap server */ - if (ldap_bind_s(ldap_connection, config.ld_binddn, config.ld_passwd, LDAP_AUTH_SIMPLE) != - LDAP_SUCCESS) { - if (verbose) { - ldap_perror(ldap_connection, "ldap_bind"); + { + mp_subcheck sc_ldap_bind = mp_subcheck_init(); + int ldap_error = + ldap_bind_s(ldap_connection, config.ld_binddn, config.ld_passwd, LDAP_AUTH_SIMPLE); + if (ldap_error != LDAP_SUCCESS) { + if (verbose) { + ldap_perror(ldap_connection, "ldap_bind"); + } + + xasprintf(&sc_ldap_bind.output, "could not bind to the LDAP server: %s", + ldap_err2string(ldap_error)); + sc_ldap_bind = mp_set_subcheck_state(sc_ldap_bind, STATE_CRITICAL); + mp_add_subcheck_to_check(&overall, sc_ldap_bind); + mp_exit(overall); + } else { + xasprintf(&sc_ldap_bind.output, "execute bind to the LDAP server"); + sc_ldap_bind = mp_set_subcheck_state(sc_ldap_bind, STATE_OK); + mp_add_subcheck_to_check(&overall, sc_ldap_bind); } - printf(_("Could not bind to the LDAP server\n")); - return STATE_CRITICAL; } LDAPMessage *result; - int num_entries = 0; /* do a search of all objectclasses in the base dn */ - if (ldap_search_s(ldap_connection, config.ld_base, - (config.crit_entries != NULL || config.warn_entries != NULL) - ? LDAP_SCOPE_SUBTREE - : LDAP_SCOPE_BASE, - config.ld_attr, NULL, 0, &result) != LDAP_SUCCESS) { - if (verbose) { - ldap_perror(ldap_connection, "ldap_search"); + { + mp_subcheck sc_ldap_search = mp_subcheck_init(); + int ldap_error = ldap_search_s( + ldap_connection, config.ld_base, + (config.entries_thresholds.warning_is_set || config.entries_thresholds.critical_is_set) + ? LDAP_SCOPE_SUBTREE + : LDAP_SCOPE_BASE, + config.ld_attr, NULL, 0, &result); + + if (ldap_error != LDAP_SUCCESS) { + if (verbose) { + ldap_perror(ldap_connection, "ldap_search"); + } + xasprintf(&sc_ldap_search.output, "could not search/find objectclasses in %s: %s", + config.ld_base, ldap_err2string(ldap_error)); + sc_ldap_search = mp_set_subcheck_state(sc_ldap_search, STATE_CRITICAL); + mp_add_subcheck_to_check(&overall, sc_ldap_search); + mp_exit(overall); + } else { + xasprintf(&sc_ldap_search.output, "search/find objectclasses in %s", config.ld_base); + sc_ldap_search = mp_set_subcheck_state(sc_ldap_search, STATE_OK); + mp_add_subcheck_to_check(&overall, sc_ldap_search); } - printf(_("Could not search/find objectclasses in %s\n"), config.ld_base); - return STATE_CRITICAL; } - if (config.crit_entries != NULL || config.warn_entries != NULL) { - num_entries = ldap_count_entries(ldap_connection, result); + int num_entries = ldap_count_entries(ldap_connection, result); + if (verbose) { + printf("entries found: %d\n", num_entries); } /* unbind from the ldap server */ @@ -193,46 +267,41 @@ int main(int argc, char *argv[]) { alarm(0); /* calculate the elapsed time and compare to thresholds */ - long microsec = deltime(start_time); double elapsed_time = (double)microsec / 1.0e6; - mp_state_enum status = STATE_UNKNOWN; - if (config.crit_time_set && elapsed_time > config.crit_time) { - status = STATE_CRITICAL; - } else if (config.warn_time_set && elapsed_time > config.warn_time) { - status = STATE_WARNING; - } else { - status = STATE_OK; - } + mp_perfdata pd_connection_time = perfdata_init(); + pd_connection_time.label = "time"; + pd_connection_time.value = mp_create_pd_value(elapsed_time); + pd_connection_time = mp_pd_set_thresholds(pd_connection_time, config.connection_time_threshold); - if (config.entries_thresholds != NULL) { - if (verbose) { - printf("entries found: %d\n", num_entries); - print_thresholds("entry thresholds", config.entries_thresholds); - } - mp_state_enum status_entries = get_status(num_entries, config.entries_thresholds); - if (status_entries == STATE_CRITICAL) { - status = STATE_CRITICAL; - } else if (status != STATE_CRITICAL) { - status = status_entries; - } - } + mp_subcheck sc_connection_time = mp_subcheck_init(); + mp_add_perfdata_to_subcheck(&sc_connection_time, pd_connection_time); + + mp_state_enum connection_time_state = mp_get_pd_status(pd_connection_time); + sc_connection_time = mp_set_subcheck_state(sc_connection_time, connection_time_state); - /* print out the result */ - if (config.crit_entries != NULL || config.warn_entries != NULL) { - printf(_("LDAP %s - found %d entries in %.3f seconds|%s %s\n"), state_text(status), - num_entries, elapsed_time, - fperfdata("time", elapsed_time, "s", config.warn_time_set, config.warn_time, - config.crit_time_set, config.crit_time, true, 0, false, 0), - sperfdata("entries", (double)num_entries, "", config.warn_entries, - config.crit_entries, true, 0.0, false, 0.0)); + if (connection_time_state == STATE_OK) { + xasprintf(&sc_connection_time.output, "connection time %.3fs is withing thresholds", + elapsed_time); } else { - printf(_("LDAP %s - %.3f seconds response time|%s\n"), state_text(status), elapsed_time, - fperfdata("time", elapsed_time, "s", config.warn_time_set, config.warn_time, - config.crit_time_set, config.crit_time, true, 0, false, 0)); + xasprintf(&sc_connection_time.output, "connection time %.3fs is violating thresholds", + elapsed_time); } - exit(status); + mp_add_subcheck_to_check(&overall, sc_connection_time); + + mp_perfdata pd_num_entries = perfdata_init(); + pd_num_entries.label = "entries"; + pd_num_entries.value = mp_create_pd_value(num_entries); + pd_num_entries = mp_pd_set_thresholds(pd_num_entries, config.entries_thresholds); + + mp_subcheck sc_num_entries = mp_subcheck_init(); + xasprintf(&sc_num_entries.output, "found %d entries", num_entries); + sc_num_entries = mp_set_subcheck_state(sc_num_entries, mp_get_pd_status(pd_num_entries)); + + mp_add_subcheck_to_check(&overall, sc_num_entries); + + mp_exit(overall); } /* process command-line arguments */ @@ -319,20 +388,38 @@ check_ldap_config_wrapper process_arguments(int argc, char **argv) { case 'P': result.config.ld_passwd = optarg; break; - case 'w': - result.config.warn_time_set = true; - result.config.warn_time = strtod(optarg, NULL); - break; - case 'c': - result.config.crit_time_set = true; - result.config.crit_time = strtod(optarg, NULL); - break; - case 'W': - result.config.warn_entries = optarg; - break; - case 'C': - result.config.crit_entries = optarg; - break; + case 'w': { + mp_range_parsed tmp = mp_parse_range_string(optarg); + if (tmp.error != MP_PARSING_SUCCES) { + die(STATE_UNKNOWN, "failed to parse warning connection time threshold"); + } + result.config.connection_time_threshold = + mp_thresholds_set_warn(result.config.connection_time_threshold, tmp.range); + } break; + case 'c': { + mp_range_parsed tmp = mp_parse_range_string(optarg); + if (tmp.error != MP_PARSING_SUCCES) { + die(STATE_UNKNOWN, "failed to parse critical connection time threshold"); + } + result.config.connection_time_threshold = + mp_thresholds_set_crit(result.config.connection_time_threshold, tmp.range); + } break; + case 'W': { + mp_range_parsed tmp = mp_parse_range_string(optarg); + if (tmp.error != MP_PARSING_SUCCES) { + die(STATE_UNKNOWN, "failed to parse number of entries warning threshold"); + } + result.config.connection_time_threshold = + mp_thresholds_set_warn(result.config.entries_thresholds, tmp.range); + } break; + case 'C': { + mp_range_parsed tmp = mp_parse_range_string(optarg); + if (tmp.error != MP_PARSING_SUCCES) { + die(STATE_UNKNOWN, "failed to parse number of entries critical threshold"); + } + result.config.connection_time_threshold = + mp_thresholds_set_crit(result.config.entries_thresholds, tmp.range); + } break; #ifdef HAVE_LDAP_SET_OPTION case '2': result.config.ld_protocol = 2; @@ -406,11 +493,6 @@ check_ldap_config_wrapper validate_arguments(check_ldap_config_wrapper config_wr usage4(_("Please specify the LDAP base\n")); } - if (config_wrapper.config.crit_entries != NULL || config_wrapper.config.warn_entries != NULL) { - set_thresholds(&config_wrapper.config.entries_thresholds, - config_wrapper.config.warn_entries, config_wrapper.config.crit_entries); - } - if (config_wrapper.config.ld_passwd == NULL) { config_wrapper.config.ld_passwd = getenv("LDAP_PASSWORD"); } -- cgit v1.2.3-74-g34f1 From 2e3dff775dd92ea9880221c800f6dc6e53162fb4 Mon Sep 17 00:00:00 2001 From: Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> Date: Tue, 25 Nov 2025 12:37:42 +0100 Subject: check_ldap: fix typo --- plugins/check_ldap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/check_ldap.c') diff --git a/plugins/check_ldap.c b/plugins/check_ldap.c index f1380be4..c3f83901 100644 --- a/plugins/check_ldap.c +++ b/plugins/check_ldap.c @@ -281,7 +281,7 @@ int main(int argc, char *argv[]) { sc_connection_time = mp_set_subcheck_state(sc_connection_time, connection_time_state); if (connection_time_state == STATE_OK) { - xasprintf(&sc_connection_time.output, "connection time %.3fs is withing thresholds", + xasprintf(&sc_connection_time.output, "connection time %.3fs is within thresholds", elapsed_time); } else { xasprintf(&sc_connection_time.output, "connection time %.3fs is violating thresholds", -- cgit v1.2.3-74-g34f1 From d6c4b799e3416d70448dea9ea886d29dbf69c820 Mon Sep 17 00:00:00 2001 From: Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> Date: Tue, 25 Nov 2025 12:41:07 +0100 Subject: check_ldap: implement output format selection --- plugins/check_ldap.c | 22 ++++++++++++++++++++++ plugins/check_ldap.d/config.h | 6 ++++++ 2 files changed, 28 insertions(+) (limited to 'plugins/check_ldap.c') diff --git a/plugins/check_ldap.c b/plugins/check_ldap.c index c3f83901..8ee0e617 100644 --- a/plugins/check_ldap.c +++ b/plugins/check_ldap.c @@ -82,6 +82,10 @@ int main(int argc, char *argv[]) { const check_ldap_config config = tmp_config.config; + if (config.output_format_is_set) { + mp_set_format(config.output_format); + } + /* initialize alarm signal handling */ signal(SIGALRM, socket_timeout_alarm_handler); @@ -306,6 +310,10 @@ int main(int argc, char *argv[]) { /* process command-line arguments */ check_ldap_config_wrapper process_arguments(int argc, char **argv) { + enum { + output_format_index = CHAR_MAX + 1, + }; + /* initialize the long option struct */ static struct option longopts[] = {{"help", no_argument, 0, 'h'}, {"version", no_argument, 0, 'V'}, @@ -329,6 +337,7 @@ check_ldap_config_wrapper process_arguments(int argc, char **argv) { {"warn-entries", required_argument, 0, 'W'}, {"crit-entries", required_argument, 0, 'C'}, {"verbose", no_argument, 0, 'v'}, + {"output-format", required_argument, 0, output_format_index}, {0, 0, 0, 0}}; check_ldap_config_wrapper result = { @@ -458,6 +467,18 @@ check_ldap_config_wrapper process_arguments(int argc, char **argv) { usage(_("IPv6 support not available\n")); #endif break; + case output_format_index: { + parsed_output_format parser = mp_parse_output_format(optarg); + if (!parser.parsing_success) { + // TODO List all available formats here, maybe add anothoer usage function + printf("Invalid output format: %s\n", optarg); + exit(STATE_UNKNOWN); + } + + result.config.output_format_is_set = true; + result.config.output_format = parser.output_format; + break; + } default: usage5(); } @@ -553,6 +574,7 @@ void print_help(void) { printf(UT_CONN_TIMEOUT, DEFAULT_SOCKET_TIMEOUT); printf(UT_VERBOSE); + printf(UT_OUTPUT_FORMAT); printf("\n"); printf("%s\n", _("Notes:")); diff --git a/plugins/check_ldap.d/config.h b/plugins/check_ldap.d/config.h index 9e6bb845..50191725 100644 --- a/plugins/check_ldap.d/config.h +++ b/plugins/check_ldap.d/config.h @@ -1,6 +1,7 @@ #pragma once #include "../../config.h" +#include "output.h" #include "thresholds.h" #include @@ -27,6 +28,9 @@ typedef struct { mp_thresholds entries_thresholds; mp_thresholds connection_time_threshold; + + bool output_format_is_set; + mp_output_format output_format; } check_ldap_config; check_ldap_config check_ldap_config_init() { @@ -45,6 +49,8 @@ check_ldap_config check_ldap_config_init() { .entries_thresholds = mp_thresholds_init(), .connection_time_threshold = mp_thresholds_init(), + + .output_format_is_set = false, }; return tmp; } -- cgit v1.2.3-74-g34f1 From 94642b3171d3dd0045004fdce834d54989e67523 Mon Sep 17 00:00:00 2001 From: Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> Date: Tue, 25 Nov 2025 13:47:47 +0100 Subject: check_ldap: add number of entries perfdata --- plugins/check_ldap.c | 1 + 1 file changed, 1 insertion(+) (limited to 'plugins/check_ldap.c') diff --git a/plugins/check_ldap.c b/plugins/check_ldap.c index 8ee0e617..1070650e 100644 --- a/plugins/check_ldap.c +++ b/plugins/check_ldap.c @@ -300,6 +300,7 @@ int main(int argc, char *argv[]) { pd_num_entries = mp_pd_set_thresholds(pd_num_entries, config.entries_thresholds); mp_subcheck sc_num_entries = mp_subcheck_init(); + mp_add_perfdata_to_subcheck(&sc_num_entries, pd_num_entries); xasprintf(&sc_num_entries.output, "found %d entries", num_entries); sc_num_entries = mp_set_subcheck_state(sc_num_entries, mp_get_pd_status(pd_num_entries)); -- cgit v1.2.3-74-g34f1 From dccc974e45b2ee533f83b3485caf5130f5736196 Mon Sep 17 00:00:00 2001 From: Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> Date: Tue, 25 Nov 2025 13:48:01 +0100 Subject: check_ldap: fix thresholds for number of entries --- plugins/check_ldap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'plugins/check_ldap.c') diff --git a/plugins/check_ldap.c b/plugins/check_ldap.c index 1070650e..1b2e2826 100644 --- a/plugins/check_ldap.c +++ b/plugins/check_ldap.c @@ -419,7 +419,7 @@ check_ldap_config_wrapper process_arguments(int argc, char **argv) { if (tmp.error != MP_PARSING_SUCCES) { die(STATE_UNKNOWN, "failed to parse number of entries warning threshold"); } - result.config.connection_time_threshold = + result.config.entries_thresholds = mp_thresholds_set_warn(result.config.entries_thresholds, tmp.range); } break; case 'C': { @@ -427,8 +427,8 @@ check_ldap_config_wrapper process_arguments(int argc, char **argv) { if (tmp.error != MP_PARSING_SUCCES) { die(STATE_UNKNOWN, "failed to parse number of entries critical threshold"); } - result.config.connection_time_threshold = - mp_thresholds_set_crit(result.config.entries_thresholds, tmp.range); + result.config.entries_thresholds = + mp_thresholds_set_crit(result.config.entries_thresholds, tmp.range); } break; #ifdef HAVE_LDAP_SET_OPTION case '2': -- cgit v1.2.3-74-g34f1