Module: check_mk
Branch: master
Commit: 7fa7217682dbbe84718dc4e2d354e331fa53bee7
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7fa7217682dbbe…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sat Oct 24 15:27:34 2015 +0200
#2667 FIX solaris_mem: fix exception in inventory plugin
---
.werks/2667 | 9 +++++++++
ChangeLog | 1 +
inventory/solaris_mem | 20 ++++++++++++--------
3 files changed, 22 insertions(+), 8 deletions(-)
diff --git a/.werks/2667 b/.werks/2667
new file mode 100644
index 0000000..4fd6c1d
--- /dev/null
+++ b/.werks/2667
@@ -0,0 +1,9 @@
+Title: solaris_mem: fix exception in inventory plugin
+Level: 1
+Component: inv
+Compatible: compat
+Version: 1.2.7i4
+Date: 1445693228
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 44c76d3..32aa5e0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -38,6 +38,7 @@
HW/SW-Inventory:
* 2436 NetApp monitoring: Now able to gather data for inventory...
+ * 2667 FIX: solaris_mem: fix exception in inventory plugin
1.2.7i3:
diff --git a/inventory/solaris_mem b/inventory/solaris_mem
index 3f42b5f..4d9a708 100644
--- a/inventory/solaris_mem
+++ b/inventory/solaris_mem
@@ -34,17 +34,21 @@
# swap.total 203939356672
# swap.used 116191281152
-def inv_solaris_mem(info):
+# statgrab_mem has a parse function with the following output:
+# {
+# 'SwapTotal' : 0,
+# 'Cached' : 0,
+# 'MemFree' : 1582464, # kB
+# 'MemTotal' : 2017928, # kB
+# 'SwapFree' : 0,
+# }
+
+def inv_solaris_mem(parsed):
node = inv_tree("hardware.memory.")
- for key, value in info:
- if key == "mem.total":
- node["total_ram_usable"] = int(value)
- if key == "swap.total":
- node["total_swap"] = int(value)
+ node["total_ram_usable"] = parsed["MemTotal"] * 1024
+ node["total_swap"] = parsed["SwapTotal"] * 1024
inv_info['statgrab_mem'] = {
"inv_function" : inv_solaris_mem,
}
-
-