Module: check_mk
Branch: master
Commit: fa20e18701ffcf1e49490c448de2d66d165f10e2
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fa20e18701ffcf…
Author: Florian Heigl <fh(a)mathias-kettner.de>
Date: Thu Mar 29 17:44:24 2012 +0200
mem.win - change the Check to check the "swap" when we talk about the
"pagefile".
otherwise it might monitor the total VSS.
This is an update to Bug #021.
Thanks to our favority brewery for reporting this (Yes, seriously)
---
checks/mem | 17 +++++------------
1 files changed, 5 insertions(+), 12 deletions(-)
diff --git a/checks/mem b/checks/mem
index 8282a4b..c360e76 100644
--- a/checks/mem
+++ b/checks/mem
@@ -7,7 +7,7 @@
# | | |___| | | | __/ (__| < | | | | . \ |
# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
# | |
-# | Copyright Mathias Kettner 2012 mk(a)mathias-kettner.de |
+# | Copyright Mathias Kettner 2010 mk(a)mathias-kettner.de |
# +------------------------------------------------------------------+
#
# This file is part of Check_MK.
@@ -120,14 +120,8 @@ def check_mem_used(item, params, info):
return (0, 'OK - %s' % infotext, 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" ],
-}
+check_info['mem.used'] = (check_mem_used, "Memory used", 1,
inventory_mem_used)
+check_config_variables.append("mem_extended_perfdata")
# +----------------------------------------------------------------------+
@@ -151,7 +145,7 @@ factory_settings["memory_win_default_levels"] = {
def inventory_mem_win(info):
meminfo = parse_proc_meminfo(info)
- if "PageTotal" in meminfo:
+ if "SwapTotal" in meminfo:
return [(None, {})]
def check_mem_windows(item, params, info):
@@ -162,7 +156,7 @@ def check_mem_windows(item, params, info):
worststate = 0
for title, what, paramname in [
( "Memory", "Mem", "memory" ),
- ( "Page file", "Page", "pagefile" )]:
+ ( "Page file", "Swap", "pagefile" )]:
total_kb = meminfo[what + "Total"]
free_kb = meminfo[what + "Free"]
used_kb = total_kb - free_kb
@@ -198,7 +192,6 @@ 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"
# +----------------------------------------------------------------------+