Module: check_mk
Branch: master
Commit: 5e9b312b59a57e5048ccfe2fc0c3ea0b0c9d5262
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5e9b312b59a57e…
Author: Florian Heigl <fh(a)mathias-kettner.de>
Date: Wed Apr 4 21:11:16 2012 +0200
Revert "mem.win - change the Check to check the "swap" when we talk about
the "pagefile"."
The patch made linux hosts detect mem.win.
This reverts commit fa20e18701ffcf1e49490c448de2d66d165f10e2.
---
checks/mem | 17 ++++++++++++-----
1 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/checks/mem b/checks/mem
index c360e76..8282a4b 100644
--- a/checks/mem
+++ b/checks/mem
@@ -7,7 +7,7 @@
# | | |___| | | | __/ (__| < | | | | . \ |
# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
# | |
-# | Copyright Mathias Kettner 2010 mk(a)mathias-kettner.de |
+# | Copyright Mathias Kettner 2012 mk(a)mathias-kettner.de |
# +------------------------------------------------------------------+
#
# This file is part of Check_MK.
@@ -120,8 +120,14 @@ def check_mem_used(item, params, info):
return (0, 'OK - %s' % infotext, perfdata)
-check_info['mem.used'] = (check_mem_used, "Memory used", 1,
inventory_mem_used)
-check_config_variables.append("mem_extended_perfdata")
+check_info['mem.used'] = {
+ "check_function" : check_mem_used,
+ "inventory_function" : inventory_mem_used,
+ "service_description" : "Memory used",
+ "has_perfdata" : True,
+ "group" : "memory",
+ "check_config_variables" : [ "mem_extended_perfdata" ],
+}
# +----------------------------------------------------------------------+
@@ -145,7 +151,7 @@ factory_settings["memory_win_default_levels"] = {
def inventory_mem_win(info):
meminfo = parse_proc_meminfo(info)
- if "SwapTotal" in meminfo:
+ if "PageTotal" in meminfo:
return [(None, {})]
def check_mem_windows(item, params, info):
@@ -156,7 +162,7 @@ def check_mem_windows(item, params, info):
worststate = 0
for title, what, paramname in [
( "Memory", "Mem", "memory" ),
- ( "Page file", "Swap", "pagefile" )]:
+ ( "Page file", "Page", "pagefile" )]:
total_kb = meminfo[what + "Total"]
free_kb = meminfo[what + "Free"]
used_kb = total_kb - free_kb
@@ -192,6 +198,7 @@ def check_mem_windows(item, params, info):
check_info['mem.win'] = (check_mem_windows, "Memory and pagefile", 1,
inventory_mem_win)
+checkgroup_of['mem.win'] = "memory_pagefile_win"
# +----------------------------------------------------------------------+