Module: check_mk
Branch: master
Commit: e78330cbc317cc175949596cc6b4db9375d52c38
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e78330cbc317cc…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Feb 11 11:26:49 2016 +0100
#3051 FIX lnx_distro: Correctly detecting Check_MK Appliance Operating System now
---
.werks/3051 | 9 +++++++++
ChangeLog | 1 +
agents/plugins/mk_inventory.linux | 2 +-
inventory/lnx_distro | 15 ++++++++++++++-
4 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/.werks/3051 b/.werks/3051
new file mode 100644
index 0000000..0f60a5e
--- /dev/null
+++ b/.werks/3051
@@ -0,0 +1,9 @@
+Title: lnx_distro: Correctly detecting Check_MK Appliance Operating System now
+Level: 1
+Component: inv
+Compatible: compat
+Version: 1.2.7i4
+Date: 1455186399
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 8f85c07..3daf38c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -415,6 +415,7 @@
* 2828 FIX: win_disks: now able to handle disks with missing size or media type
information
* 2906 FIX: Fixed crash in views containing special chars in HW/SW-Inventory based
columns
* 3170 FIX: Fix spurious exception while creating the inventory directory for the
first time
+ * 3051 FIX: lnx_distro: Correctly detecting Check_MK Appliance Operating System now
1.2.7i3:
diff --git a/agents/plugins/mk_inventory.linux b/agents/plugins/mk_inventory.linux
index 1d76605..3b8fd92 100755
--- a/agents/plugins/mk_inventory.linux
+++ b/agents/plugins/mk_inventory.linux
@@ -52,7 +52,7 @@ then
# Information about distribution
echo "<<<lnx_distro:sep(124):persist($UNTIL)>>>"
- for f in /etc/{debian_version,lsb-release,redhat-release,SuSE-release} ; do
+ for f in
{/etc/{debian_version,lsb-release,redhat-release,SuSE-release},/usr/share/cma/version} ;
do
if [ -e $f ] ; then
echo -n "$f|" ; tr \\n \| < $f | sed 's/|$//' ; echo
fi
diff --git a/inventory/lnx_distro b/inventory/lnx_distro
index 0e52ea5..c8fc2ed 100644
--- a/inventory/lnx_distro
+++ b/inventory/lnx_distro
@@ -42,13 +42,16 @@ def inv_lnx_distro(info):
node = inv_tree("software.os.")
for line in info:
if line[0] == '/etc/lsb-release':
- inv_lnx_parse_lsb_release(node, line[1:])
+ inv_lnx_parse_lsb_release(node, line[1:])
elif line[0] == '/etc/debian_version':
inv_lnx_parse_debian(node, line[1])
elif line[0] == '/etc/redhat-release':
inv_lnx_parse_redhat_release(node, line[1])
elif line[0] == '/etc/SuSE-release':
inv_lnx_parse_suse_release(node, line[1:])
+ elif line[0] == '/usr/share/cma/version':
+ inv_lnx_parse_cma(node, line[1])
+
def inv_lnx_parse_suse_release(node, line):
node["type"] = "linux"
@@ -73,6 +76,7 @@ def inv_lnx_parse_suse_release(node, line):
elif version == "13.1":
node["code_name"] = "Bottle"
+
def inv_lnx_parse_redhat_release(node, line):
node["type"] = "linux"
parts = line.split("(")
@@ -99,6 +103,7 @@ def inv_lnx_parse_lsb_release(node, lines):
elif varname == "DISTRIB_DESCRIPTION":
node["name"] = value
+
def inv_lnx_parse_debian(node, line):
node["type"] = "linux"
if "name" not in node: # Do not overwrite Ubuntu information
@@ -127,6 +132,14 @@ def inv_lnx_parse_debian(node, line):
node["code_name"] = "Jessie"
+def inv_lnx_parse_cma(node, line):
+ node["type"] = "linux"
+ node["name"] = "Check_MK Appliance " + line
+ node["vendor"] = "Mathias Kettner GmbH"
+ node["version"] = line
+ if "code_name" in node:
+ del node["code_name"]
+
inv_info['lnx_distro'] = {
"inv_function" : inv_lnx_distro,