aboutsummaryrefslogtreecommitdiff
path: root/plugins/check_ldap.c
diff options
context:
space:
mode:
authorGravatar Sven Nierlein <sven@nierlein.de> 2015-04-22 11:44:13 +0200
committerGravatar Sven Nierlein <sven@nierlein.de> 2015-04-22 12:51:29 +0200
commit169fbdae7e619c1e6623c79366ec7ba4c1c613e9 (patch)
tree282d7451892c5960c4f4300e1427ad2cc0dad10a /plugins/check_ldap.c
parentd309b1d2e90fecdf243952fbb0cf819be38b9c8b (diff)
downloadmonitoring-plugins-169fbdae7e619c1e6623c79366ec7ba4c1c613e9.tar.gz
check_ldap: fix entries threshold check
fix typo in threshold check. instead of setting the state always to warning, use the result from the thresholds entry check. Signed-off-by: Sven Nierlein <sven@nierlein.de>
Diffstat (limited to 'plugins/check_ldap.c')
-rw-r--r--plugins/check_ldap.c36
1 files changed, 21 insertions, 15 deletions
diff --git a/plugins/check_ldap.c b/plugins/check_ldap.c
index 1c09dfa0..cfc8222a 100644
--- a/plugins/check_ldap.c
+++ b/plugins/check_ldap.c
@@ -1,29 +1,29 @@
/*****************************************************************************
-*
+*
* Monitoring check_ldap plugin
-*
+*
* License: GPL
* Copyright (c) 2000-2008 Monitoring Plugins Development Team
-*
+*
* Description:
-*
+*
* This file contains the check_ldap plugin
-*
-*
+*
+*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-*
+*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
-*
-*
+*
+*
*****************************************************************************/
/* progname may be check_ldaps */
@@ -234,11 +234,17 @@ main (int argc, char *argv[])
else
status = STATE_OK;
- status_entries = get_status(num_entries, entries_thresholds);
- if (status_entries == STATE_CRITICAL) {
- status = STATE_CRITICAL;
- } else if (status!=STATE_CRITICAL) {
- status = STATE_WARNING;
+ if(entries_thresholds != NULL) {
+ if (verbose) {
+ printf ("entries found: %d\n", num_entries);
+ print_thresholds("entry threasholds", entries_thresholds);
+ }
+ status_entries = get_status(num_entries, entries_thresholds);
+ if (status_entries == STATE_CRITICAL) {
+ status = STATE_CRITICAL;
+ } else if (status != STATE_CRITICAL) {
+ status = status_entries;
+ }
}
/* print out the result */