Module: check_mk
Branch: master
Commit: 8aadece285e705cab90fb78319d26d48f693b68a
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8aadece285e705…
Author: Moritz Kiemer <mo(a)mathias-kettner.de>
Date: Mon Jan 28 11:23:09 2019 +0100
7133 FIX mem.win: Change label from "Commit Charge" to "Page file"
The agent actually reports total/available page file, so adjust the check output
accordingly and replace the confusing "Commit Charge" label.
This change only affects the displayed text.
Change-Id: I312ef9e964d83421d26da415c9a2a3fe24a33709
---
.werks/7133 | 12 +++++++++
checkman/mem.win | 29 +++++-----------------
checks/mem | 2 +-
.../generictests/datasets/mem_win_regression.py | 4 +--
4 files changed, 21 insertions(+), 26 deletions(-)
diff --git a/.werks/7133 b/.werks/7133
new file mode 100644
index 0000000..7497b8b
--- /dev/null
+++ b/.werks/7133
@@ -0,0 +1,12 @@
+Title: mem.win: Change label from "Commit Charge" to "Page file"
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.6.0i1
+Date: 1548670807
+Class: fix
+
+The agent actually reports total/available page file, so adjust the check output
+accordingly and replace the confusing "Commit Charge" label.
+This change only affects the displayed text.
diff --git a/checkman/mem.win b/checkman/mem.win
index 79c86cf..ae5c0b2 100644
--- a/checkman/mem.win
+++ b/checkman/mem.win
@@ -5,30 +5,13 @@ license: GPL
distribution: check_mk
description:
This check measures the current usage of physical RAM and
- of the commit charge.
- The "commit charge" was previously confusingly named "pagefile".
- Please note that Microsoft themselves use this naming in
- some applications.
-
- Due to how Windows optimizes memory management, physical memory
- is in practice almost always fully utilized. The Memory usage this
- check displays says how much memory is actually required by processes,
- in contrast to caches that could be freed if the need arises.
-
- In the same vein Windows may hold data in RAM and pagefile at the same
- time or it may hold data in the pagefile even when there is RAM available,
- when it determines this may improve performance.
- As a result, the real pagefile usage is not only hard to
- determine, it's also utterly useless when we want to determine
- resource usage on the system.
-
- The commit charge instead tells us how much of the memory used in
- total (RAM + swap) is really required, ignoring overlap and caches.
- Commit Charge minus Memory Usage is approximately the amount
- of the pagefile used for "relevant" data, but further optimizations
- may lead to offsets (to the point where Commit Charge - Memory Usage
- can be negative).
+ of the page file.
+ The page file metric is determined using the fields 'ullTotalPageFile'
+ (current committed memory limit for the system or the current
+ process, whichever is smaller) and 'ullAvailPageFile' (maximum
+ amount of memory the current process can commit) of the MEMORYSTATUSEX
+ structure as returned by the windows API function 'GlobalMemoryStatusEx'.
item:
{None}
diff --git a/checks/mem b/checks/mem
index d5ebd98..b512dd5 100644
--- a/checks/mem
+++ b/checks/mem
@@ -551,7 +551,7 @@ def check_mem_windows(_no_item, params, info):
return warn, crit
for title, prefix, paramname in [("Memory usage", "Mem",
"memory"),
- ("Commit Charge", "Page",
"pagefile")]:
+ ("Page file", "Page",
"pagefile")]:
total_kb = meminfo.get("%sTotal" % prefix)
free_kb = meminfo.get("%sFree" % prefix)
diff --git a/tests/unit/checks/generictests/datasets/mem_win_regression.py
b/tests/unit/checks/generictests/datasets/mem_win_regression.py
index 86d1460..dae0614 100644
--- a/tests/unit/checks/generictests/datasets/mem_win_regression.py
+++ b/tests/unit/checks/generictests/datasets/mem_win_regression.py
@@ -25,7 +25,7 @@ checks = {
('memory', 16369.96875, 26213.990625, 29490.739453125, 0,
32767.48828125),
('mem_total', 32767.48828125, None, None, None, None),
]),
- (0, 'Commit Charge: 20.1% (19.04 GB/94.50 GB)', [
+ (0, 'Page file: 20.1% (19.04 GB/94.50 GB)', [
('pagefile', 19491.90625, 77413.990625, 87090.739453125, 0,
96767.48828125),
('pagefile_total', 96767.48828125, None, None, None, None),
]),
@@ -35,7 +35,7 @@ checks = {
('memory', 16369.96875, 26214.48828125, 29490.48828125, 0,
32767.48828125),
('mem_total', 32767.48828125, None, None, None, None),
]),
- (2, 'Commit Charge: 20.1% (19.04 GB/94.50 GB)', [
+ (2, 'Page file: 20.1% (19.04 GB/94.50 GB)', [
('pagefile', 19491.90625, 77275.48828125, 19353.48828125, 0,
96767.48828125),
('pagefile_total', 96767.48828125, None, None, None, None),
]),