Module: check_mk
Branch: master
Commit: 1046b6324028a3ba1adb0f3bf2a87f2861467cb5
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1046b6324028a3…
Author: Sven Rueß <sr(a)mathias-kettner.de>
Date: Wed Feb 1 15:04:40 2017 +0100
4344 FIX lnx_quota: Fixed wrong value calculation and removed performance data
Fixed wrong value calculation for filesystem usage. Now the factor 1024
is used.
Removed the performance data for the filesystem usage and amount of files.
Reasons for this decision:
<ul>
<li>Graphing system is not able to handle such kind of dynamic performance
variables like
<ul>
<li>group_USERNAME_blocks</li>
<li>group_USERNAME_files</li>
<li>USERNAME_blocks</li>
<li>USERNAME_files</li>
</ul></li>
<li>Generated graphs use the standard logarithmic scale for painting the
filesystem usage.
This view is not useful for the user and makes the handling complicated.</li>
</ul>
The check will work as expected and does not need further user modifications or
configurations.
Change-Id: I9045a79196acef0900372bcb6d05408a0f2b42b2
---
.werks/4344 | 28 ++++++++++++++++++++++++++++
ChangeLog | 2 ++
checks/lnx_quota | 23 ++++++++++++++++-------
3 files changed, 46 insertions(+), 7 deletions(-)
diff --git a/.werks/4344 b/.werks/4344
new file mode 100644
index 0000000..82d46f4
--- /dev/null
+++ b/.werks/4344
@@ -0,0 +1,28 @@
+Title: lnx_quota: Fixed wrong value calculation and removed performance data
+Level: 1
+Component: checks
+Class: fix
+Compatible: incomp
+State: unknown
+Version: 1.4.0i4
+Date: 1485955329
+
+Fixed wrong value calculation for filesystem usage. Now the factor 1024
+is used.
+
+Removed the performance data for the filesystem usage and amount of files.
+
+Reasons for this decision:
+<ul>
+ <li>Graphing system is not able to handle such kind of dynamic performance
variables like
+ <ul>
+ <li>group_USERNAME_blocks</li>
+ <li>group_USERNAME_files</li>
+ <li>USERNAME_blocks</li>
+ <li>USERNAME_files</li>
+ </ul></li>
+ <li>Generated graphs use the standard logarithmic scale for painting the
filesystem usage.
+ This view is not useful for the user and makes the handling
complicated.</li>
+</ul>
+
+The check will work as expected and does not need further user modifications or
configurations.
diff --git a/ChangeLog b/ChangeLog
index 2b6ffd9..22fb526 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -81,6 +81,8 @@
* 4306 FIX: cisco_fru_power: fixed empty FRU current handling
* 4333 FIX: tsm_storage_pools: fixed incomplete data handling
* 4343 FIX: apt: Fixed wrong state information of pending updates of normal and
security updates...
+ * 4344 FIX: lnx_quota: Fixed wrong value calculation and removed performance data...
+ NOTE: Please refer to the migration notes!
Multisite:
* 4169 View action: Default values of sticky, notification and persistent options can
now be configured via global settings....
diff --git a/checks/lnx_quota b/checks/lnx_quota
index 9994605..a7f8e85 100644
--- a/checks/lnx_quota
+++ b/checks/lnx_quota
@@ -69,14 +69,14 @@ def parse_lnx_quota(info):
elif fs and mode and len(line) == 10:
# new table entry for quota
- parsed[fs][mode][line[0]] = map(int, line[2:])
+ parsed[fs][mode][line[0]] = map(lambda x: int(x)*1024, line[2:5]) + map(int,
line[5:])
return parsed
def lnx_quota_limit_check(mode, what, user, used, soft, hard, grace):
fmt = lambda value, what: what == 'files' and '%d' % value \
- or get_bytes_human_readable(value*1000, 1000)
+ or get_bytes_human_readable(value)
if mode == 'usr':
txt = 'User %s' % user
@@ -123,7 +123,7 @@ def inventory_lnx_quota(parsed):
def check_lnx_quota(item, params, parsed):
- perfdata = []
+ #perfdata = []
if item not in parsed:
yield 3, 'Quota info not found for this filesystem'
@@ -149,14 +149,23 @@ def check_lnx_quota(item, params, parsed):
state, txt = lnx_quota_limit_check(thing, what, user, used, soft,
hard, grace)
- perfdata.append(('%s%s_%s' % (perf_prefix, user, what),
- used*1000, soft*1000, hard*1000, 0, hard*1000))
+ # Performance data was removed, because the graphing system is not
+ # able to handle such kind of dynamic performance data. Performance
+ # variables were named like group_USERNAME_blocks,
group_USERNAME_files,
+ # USERNAME_blocks or USERNAME_files and can appear and disappear in
the
+ # configuration.
+ # Additional the graphs show the performance data like filesystem
usage
+ # in the standard logarithmic scale which is not a useful view for
the user.
+ #perfdata.append(('%s%s_%s' % (perf_prefix, user, what),
+ # used, soft, hard, 0, hard))
if txt:
at_least_one_problematic = True
- yield state, (txt + ', '), perfdata
+ yield state, (txt + ', ')
+ #yield state, (txt + ', '), perfdata
else:
- yield state, None, perfdata
+ yield state, None
+ #yield state, None, perfdata
if not at_least_one_problematic:
yield 0, 'All %s within quota limits' % name