Univention Bugzilla – Attachment 10612 Details for
Bug 49291
Improve MDB size check by subtracting the "Free pages" number from the used pages
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug49291.patch
Bug49291.patch (text/plain), 1.30 KB, created by
Arvid Requate
on 2021-02-05 18:47:44 CET
(
hide
)
Description:
Bug49291.patch
Filename:
MIME Type:
Creator:
Arvid Requate
Created:
2021-02-05 18:47:44 CET
Size:
1.30 KB
patch
obsolete
>diff --git a/nagios/univention-nagios/usr/lib/nagios/plugins/check_univention_slapd_mdb_maxsize b/nagios/univention-nagios/usr/lib/nagios/plugins/check_univention_slapd_mdb_maxsize >index eab78f7f32..138f43fed8 100755 >--- a/nagios/univention-nagios/usr/lib/nagios/plugins/check_univention_slapd_mdb_maxsize >+++ b/nagios/univention-nagios/usr/lib/nagios/plugins/check_univention_slapd_mdb_maxsize >@@ -82,13 +82,13 @@ warnings = [] > success = [] > for mdb_dir in files: > try: >- output = subprocess.check_output(['/usr/bin/mdb_stat', '-e', mdb_dir], close_fds=True, env={'LC_ALL': 'C'}) >+ output = subprocess.check_output(['/usr/bin/mdb_stat', '-ef', mdb_dir], close_fds=True, env={'LC_ALL': 'C'}) > except subprocess.CalledProcessError: >- nagios_exit(STATE_CRITICAL, 'mdb_stat -e %s failed' % (mdb_dir,)) >+ nagios_exit(STATE_CRITICAL, 'mdb_stat -ef %s failed' % (mdb_dir,)) > > stat = dict(line.strip().lower().split(': ', 1) for line in output.splitlines() if ': ' in line) > try: >- in_use = int((int(stat['number of pages used']) * 100) / int(stat['max pages'])) >+ in_use = 100 * (int(stat['number of pages used']) - int(stat['free pages'])) / int(stat['max pages']) > except KeyError: # API change in the future > nagios_exit(STATE_CRITICAL, 'output of "mdb_stat -e %s" could not be parsed: %s' % (mdb_dir, output,)) >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 49291
: 10612