From 169fbdae7e619c1e6623c79366ec7ba4c1c613e9 Mon Sep 17 00:00:00 2001 From: Sven Nierlein Date: Wed, 22 Apr 2015 11:44:13 +0200 Subject: 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 --- plugins/check_ldap.c | 36 +++++++++++++++++++++--------------- 1 file 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 . -* -* +* +* *****************************************************************************/ /* 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 */ -- cgit v1.2.3-74-g34f1