Module: check_mk
Branch: master
Commit: 953735306be7f1c8e59a7e73b72488270714dde3
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=953735306be7f1…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Mon Apr 18 13:08:47 2016 +0200
3028 statgrab_mem, solaris_mem: updated inventory plugins for solaris systems
Solaris systems either report statgrab_mem or solaris_mem sections.
The data from these sections is similar, both inventory plugins determine
the same inventory data - total ram and total swap.
---
.werks/3028 | 11 ++++++++++
ChangeLog | 1 +
inventory/solaris_mem | 33 +++++++++++-------------------
inventory/statgrab_mem | 52 ++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 76 insertions(+), 21 deletions(-)
diff --git a/.werks/3028 b/.werks/3028
new file mode 100644
index 0000000..1af9f42
--- /dev/null
+++ b/.werks/3028
@@ -0,0 +1,11 @@
+Title: statgrab_mem, solaris_mem: updated inventory plugins for solaris systems
+Level: 1
+Component: inv
+Compatible: compat
+Version: 1.2.9i1
+Date: 1460977554
+Class: feature
+
+Solaris systems either report statgrab_mem or solaris_mem sections.
+The data from these sections is similar, both inventory plugins determine
+the same inventory data - total ram and total swap.
diff --git a/ChangeLog b/ChangeLog
index 6b3c674..943d5f0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -320,6 +320,7 @@
* 3192 snmp_extended_info: now inventorizes all physical components of devices which
support the ENTITY-MIB
* 3319 HW/SW-Inventory service can now be OK in case of unreachable host...
* 3322 esx_vsphere_hostsystem: inventory now adds information about memory, uuid and
service tag...
+ * 3028 statgrab_mem, solaris_mem: updated inventory plugins for solaris systems...
* 3219 FIX: lnx_distro: Now detecting Oracle VM Server correctly
* 3229 FIX: lnx_distro: SLES based systems have now an OS name inventorized\
* 3265 FIX: mk_inventory.solaris: fix problem on Solaris 10, do prtdiag and prtpicl
only in global zone
diff --git a/inventory/solaris_mem b/inventory/solaris_mem
index ad5de97..8f7bd81 100644
--- a/inventory/solaris_mem
+++ b/inventory/solaris_mem
@@ -7,7 +7,7 @@
# | | |___| | | | __/ (__| < | | | | . \ |
# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
# | |
-# | Copyright Mathias Kettner 2014 mk(a)mathias-kettner.de |
+# | Copyright Mathias Kettner 2016 mk(a)mathias-kettner.de |
# +------------------------------------------------------------------+
#
# This file is part of Check_MK.
@@ -19,36 +19,27 @@
# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE. See the GNU General Public License for more de-
-# tails. You should have received a copy of the GNU General Public
+# ails. You should have received a copy of the GNU General Public
# License along with GNU Make; see the file COPYING. If not, write
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
+#<<<solaris_mem>>>
+#Memory: 64G phys mem, 28G free mem, 8198M total swap, 8198M free swap
-# <<<statgrab_mem>>>
-# mem.cache 0
-# mem.free 166014599168
-# mem.total 274877906944
-# mem.used 108863307776
-# swap.free 87748075520
-# swap.total 203939356672
-# swap.used 116191281152
-
-# statgrab_mem has a parse function with the following output:
+# solaris_mem a parse function with the following output:
# {
-# 'SwapTotal' : 0,
-# 'Cached' : 0,
-# 'MemFree' : 1582464, # kB
-# 'MemTotal' : 2017928, # kB
-# 'SwapFree' : 0,
+# 'MemFree': 2070528,
+# 'MemTotal': 25165824,
+# 'SwapFree': 3802112,
+# 'SwapTotal': 4194304
# }
def inv_solaris_mem(parsed):
node = inv_tree("hardware.memory.")
- node["total_ram_usable"] = parsed["MemTotal"] * 1024
- node["total_swap"] = parsed["SwapTotal"] * 1024
-
+ node["total_ram_usable"] = parsed["MemFree"]
+ node["total_swap"] = parsed["SwapTotal"]
-inv_info['statgrab_mem'] = {
+inv_info['solaris_mem'] = {
"inv_function" : inv_solaris_mem,
}
diff --git a/inventory/statgrab_mem b/inventory/statgrab_mem
new file mode 100644
index 0000000..7926a06
--- /dev/null
+++ b/inventory/statgrab_mem
@@ -0,0 +1,52 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2016 mk(a)mathias-kettner.de |
+# +------------------------------------------------------------------+
+#
+# This file is part of Check_MK.
+# The official homepage is at
http://mathias-kettner.de/check_mk.
+#
+# check_mk is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation in version 2. check_mk is distributed
+# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
+# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE. See the GNU General Public License for more de-
+# ails. You should have received a copy of the GNU General Public
+# License along with GNU Make; see the file COPYING. If not, write
+# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA.
+
+# <<<statgrab_mem>>>
+# mem.cache 0
+# mem.free 166014599168
+# mem.total 274877906944
+# mem.used 108863307776
+# swap.free 87748075520
+# swap.total 203939356672
+# swap.used 116191281152
+
+# statgrab_mem has a parse function with the following output:
+# {
+# 'SwapTotal' : 0,
+# 'Cached' : 0,
+# 'MemFree' : 1582464, # kB
+# 'MemTotal' : 2017928, # kB
+# 'SwapFree' : 0,
+# }
+def inv_statgrab_mem(parsed):
+ node = inv_tree("hardware.memory.")
+ node["total_ram_usable"] = parsed["MemTotal"] * 1024
+ node["total_swap"] = parsed["SwapTotal"] * 1024
+
+
+inv_info['statgrab_mem'] = {
+ "inv_function" : inv_statgrab_mem,
+}