diff options
-rw-r--r-- | plugins/check_ldap.c | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/plugins/check_ldap.c b/plugins/check_ldap.c index 1c09dfa..cfc8222 100644 --- a/plugins/check_ldap.c +++ b/plugins/check_ldap.c | |||
@@ -1,29 +1,29 @@ | |||
1 | /***************************************************************************** | 1 | /***************************************************************************** |
2 | * | 2 | * |
3 | * Monitoring check_ldap plugin | 3 | * Monitoring check_ldap plugin |
4 | * | 4 | * |
5 | * License: GPL | 5 | * License: GPL |
6 | * Copyright (c) 2000-2008 Monitoring Plugins Development Team | 6 | * Copyright (c) 2000-2008 Monitoring Plugins Development Team |
7 | * | 7 | * |
8 | * Description: | 8 | * Description: |
9 | * | 9 | * |
10 | * This file contains the check_ldap plugin | 10 | * This file contains the check_ldap plugin |
11 | * | 11 | * |
12 | * | 12 | * |
13 | * This program is free software: you can redistribute it and/or modify | 13 | * This program is free software: you can redistribute it and/or modify |
14 | * it under the terms of the GNU General Public License as published by | 14 | * it under the terms of the GNU General Public License as published by |
15 | * the Free Software Foundation, either version 3 of the License, or | 15 | * the Free Software Foundation, either version 3 of the License, or |
16 | * (at your option) any later version. | 16 | * (at your option) any later version. |
17 | * | 17 | * |
18 | * This program is distributed in the hope that it will be useful, | 18 | * This program is distributed in the hope that it will be useful, |
19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
21 | * GNU General Public License for more details. | 21 | * GNU General Public License for more details. |
22 | * | 22 | * |
23 | * You should have received a copy of the GNU General Public License | 23 | * You should have received a copy of the GNU General Public License |
24 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 24 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
25 | * | 25 | * |
26 | * | 26 | * |
27 | *****************************************************************************/ | 27 | *****************************************************************************/ |
28 | 28 | ||
29 | /* progname may be check_ldaps */ | 29 | /* progname may be check_ldaps */ |
@@ -234,11 +234,17 @@ main (int argc, char *argv[]) | |||
234 | else | 234 | else |
235 | status = STATE_OK; | 235 | status = STATE_OK; |
236 | 236 | ||
237 | status_entries = get_status(num_entries, entries_thresholds); | 237 | if(entries_thresholds != NULL) { |
238 | if (status_entries == STATE_CRITICAL) { | 238 | if (verbose) { |
239 | status = STATE_CRITICAL; | 239 | printf ("entries found: %d\n", num_entries); |
240 | } else if (status!=STATE_CRITICAL) { | 240 | print_thresholds("entry threasholds", entries_thresholds); |
241 | status = STATE_WARNING; | 241 | } |
242 | status_entries = get_status(num_entries, entries_thresholds); | ||
243 | if (status_entries == STATE_CRITICAL) { | ||
244 | status = STATE_CRITICAL; | ||
245 | } else if (status != STATE_CRITICAL) { | ||
246 | status = status_entries; | ||
247 | } | ||
242 | } | 248 | } |
243 | 249 | ||
244 | /* print out the result */ | 250 | /* print out the result */ |