Module: check_mk
Branch: master
Commit: 207481c5d6449981e9ab307835a392bdc498304e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=207481c5d64499…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Fri Mar 21 16:39:40 2014 +0100
mem.win: now able to configure swap file levels
---
.werks/735 | 8 ++++++++
ChangeLog | 6 +++---
checkman/mem.win | 4 ++++
checks/mem | 4 +++-
web/plugins/wato/check_parameters.py | 33 ++++++++++++++++++++++++++++++---
5 files changed, 48 insertions(+), 7 deletions(-)
diff --git a/.werks/735 b/.werks/735
new file mode 100644
index 0000000..6a0a5f4
--- /dev/null
+++ b/.werks/735
@@ -0,0 +1,8 @@
+Title: mem.win: now able to configure swap file levels
+Level: 1
+Component: checks
+Version: 1.2.5i1
+Date: 1395416329
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index d7c3284..f84dfd3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -121,11 +121,11 @@
* 0595 dell_chassis_power, dell_chassis_powersupplies: new checks for Dell Poweredge
Chassis Ppower consumption...
* 0596 dell_chassis_status, dell_chassis_temp, dell_chassis_kvm, dell_chassis_io,
dell_chassis_fans: new checks to monitor the overall status of various sections of the
Dell Poweredge Chassis via CMC
* 0597 dell_chassis_slots: new check to monitor the status of the blade slots of the
Dell Poweredge Blade Servers
- * 0145 apc_symmetra: Changed naming of Batterie Temperature to System Temerature...
- NOTE: Please refer to the migration notes!
* 0759 check_notify_count: New active check to monitor the number of notifications
sent to contacts...
* 0760 The windows agent contains meta information about version, manufacturer
etc....
->>>>>>> 309bc055d22c0013242e9c3787049fbd6afb6ff1
+ * 0145 apc_symmetra: Changed naming of Batterie Temperature to System Temerature...
+ NOTE: Please refer to the migration notes!
+ * 0735 mem.win: now able to configure swap file levels
* 0103 FIX: services: Fixed bug with service inventory defined in main.mk...
* 0299 FIX: borcade_mlx_fan: Prettified output, handling "other" state now
* 0300 FIX: cisco_fru_power: Trying not to inventorize not plugged in FRUs...
diff --git a/checkman/mem.win b/checkman/mem.win
index 296e52c..6aa124a 100644
--- a/checkman/mem.win
+++ b/checkman/mem.win
@@ -21,6 +21,7 @@ examples:
memory_win_default_levels = {
"memory" : (80.0, 90.0), # alert at 80%/90% usage
"pagefile" : (2048, 1024), # alert, if less then 2/1 GB free
+ "swap" : (2048, 1024), # alert, if less then 2/1 GB free
"average" : 60, # apply levels on 60-min average
}
@@ -45,6 +46,9 @@ parameters (dict): This check uses a dictionary as parameter. The
following
{"pagefile"} Warning and critical levels for page file usage. The same
rules apply as for {memory}.
+ {"swap"} Warning and critical levels for swap usage. The same
+ rules apply as for {memory}.
+
{"average"} This optional parameters sets a value in minutes for averaging.
In that case all warn/crit levels are applied to the averaged values.
diff --git a/checks/mem b/checks/mem
index 2e26709..a086ea0 100644
--- a/checks/mem
+++ b/checks/mem
@@ -81,6 +81,7 @@ check_info['mem.used'] = {
factory_settings["memory_win_default_levels"] = {
"memory" : ( 80.0, 90.0 ),
"pagefile" : ( 50.0, 70.0 ),
+ "swap" : ( 70.0, 80.0 ),
}
def inventory_mem_win(info):
@@ -101,7 +102,8 @@ def check_mem_windows(item, params, info):
for title, what, paramname in [
( "Memory", "Mem", "memory" ),
- ( "Page file", "Page", "pagefile" )]:
+ ( "Page file", "Page", "pagefile" ),
+ ( "Swap", "Swap", "swap" )]:
total_kb = meminfo[what + "Total"]
free_kb = meminfo[what + "Free"]
used_kb = total_kb - free_kb
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 672927d..36c71f7 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -1105,7 +1105,7 @@ register_check_parameters(
register_check_parameters(
subgroup_os,
"memory_pagefile_win",
- _("Memory and pagefile levels for Windows"),
+ _("Memory, pagefile and swap levels for Windows"),
Dictionary(
elements = [
( "memory",
@@ -1127,7 +1127,7 @@ register_check_parameters(
Filesize(title = _("Critical if less
than")),
]
),
- # Note: Filesize values lesser 1MB will not work
+ # Note: Memory values lesser 1MB will not work
# -> need hide option in filesize valuespec
back = lambda x: (x[0] / 1024 / 1024, x[1] / 1024 / 1024),
forth = lambda x: (x[0] * 1024 * 1024, x[1] * 1024 * 1024)
@@ -1153,7 +1153,7 @@ register_check_parameters(
Filesize(title = _("Critical if less
than")),
]
),
- # Note: Filesize values lesser 1MB will not work
+ # Note: Memory values lesser 1MB will not work
# -> need hide option in filesize valuespec
back = lambda x: (x[0] / 1024 / 1024, x[1] / 1024 / 1024),
forth = lambda x: (x[0] * 1024 * 1024, x[1] * 1024 * 1024)
@@ -1161,6 +1161,33 @@ register_check_parameters(
],
default_value = (50.0, 70.0))
),
+ ( "swap",
+ Alternative(
+ title = _("Swap Levels"),
+ elements = [
+ Tuple(
+ title = _("Swap usage in percent"),
+ elements = [
+ Percentage(title = _("Warning if above")),
+ Percentage(title = _("Critical if above")),
+ ]
+ ),
+ Transform(
+ Tuple(
+ title = _("Absolute free swap"),
+ elements = [
+ Filesize(title = _("Warning if less
than")),
+ Filesize(title = _("Critical if less
than")),
+ ]
+ ),
+ # Note: Memory values lesser 1MB will not work
+ # -> need hide option in filesize valuespec
+ back = lambda x: (x[0] / 1024 / 1024, x[1] / 1024 / 1024),
+ forth = lambda x: (x[0] * 1024 * 1024, x[1] * 1024 * 1024)
+ )
+ ],
+ default_value = (70.0, 80.0))
+ ),
("average",
Integer (
title = _("Averaging"),