Module: check_mk
Branch: master
Commit: cc040325edbf5e04949b9fe674fca59f442335ca
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=cc040325edbf5e…
Author: Marcel Arentz <ma(a)mathias-kettner.de>
Date: Thu Jan 18 16:05:18 2018 +0100
5554 FIX ps: Fixed missing Total RAM if AIX is the source and percentual thresholds are
configured
AIX has not been considered while computing the percentual thresholds for
Memory. This is now fixed.
Change-Id: I932b8c8e5e2ca915584aaa7bd9f24f9cfabc4763
---
.werks/5554 | 11 +++++++++++
checks/ps | 10 ++++++----
2 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/.werks/5554 b/.werks/5554
new file mode 100644
index 0000000..cb1127a
--- /dev/null
+++ b/.werks/5554
@@ -0,0 +1,11 @@
+Title: ps: Fixed missing Total RAM if AIX is the source and percentual thresholds are
configured
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.5.0i3
+Date: 1516287829
+Class: fix
+
+AIX has not been considered while computing the percentual thresholds for
+Memory. This is now fixed.
diff --git a/checks/ps b/checks/ps
index ac99281..74f97f9 100644
--- a/checks/ps
+++ b/checks/ps
@@ -236,18 +236,20 @@ def parse_ps(info):
def inventory_ps(info):
- (cpu_cores, parsed), mem_info, solaris_mem_info, statgrab_mem_info = info
+ (cpu_cores, parsed), mem_info, solaris_mem_info, statgrab_mem_info, aix_memory_info =
info
return inventory_ps_common(inventory_processes, inventory_processes_rules, parsed)
def check_ps(item, params, info):
- (cpu_cores, parsed), mem_info, solaris_mem_info, statgrab_mem_info = info
+ (cpu_cores, parsed), mem_info, solaris_mem_info, statgrab_mem_info, aix_memory_info =
info
if mem_info:
total_ram = parse_proc_meminfo_bytes(mem_info).get("MemTotal")
elif solaris_mem_info:
total_ram = solaris_mem_info.get("MemTotal") * 1024
elif statgrab_mem_info:
total_ram = statgrab_mem_info.get("MemTotal") * 1024
+ elif aix_memory_info:
+ total_ram = int(aix_memory_info[0][0]) * 4 * 1024
else:
total_ram = None
@@ -264,7 +266,7 @@ check_info['ps'] = {
"node_info" : True, # add first column with actual host name
"group" : "ps",
"default_levels_variable" : "ps_default_levels",
- "extra_sections" : [ "mem", "solaris_mem",
"statgrab_mem" ],
+ "extra_sections" : [ "mem", "solaris_mem",
"statgrab_mem", "aix_memory" ],
}
# NOTE: This check is deprecated and will be removed any decade now. ps now
@@ -277,5 +279,5 @@ check_info['ps.perf'] = {
"node_info" : True, # add first column with actual host name
"group" : "ps",
"default_levels_variable" : "ps_default_levels",
- "extra_sections" : [ "mem", "solaris_mem",
"statgrab_mem" ],
+ "extra_sections" : [ "mem", "solaris_mem",
"statgrab_mem", "aix_memory" ],
}