Module: check_mk
Branch: master
Commit: fd8c092e5924bed73d76f676fce62c2795cbdd67
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fd8c092e5924be…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Mar 2 14:36:03 2016 +0100
#3229 FIX lnx_distro: SLES based systems have now an OS name inventorized\
---
.werks/3229 | 10 ++++++++++
ChangeLog | 1 +
inventory/lnx_distro | 26 ++++++++++++++++----------
3 files changed, 27 insertions(+), 10 deletions(-)
diff --git a/.werks/3229 b/.werks/3229
new file mode 100644
index 0000000..b75de45
--- /dev/null
+++ b/.werks/3229
@@ -0,0 +1,10 @@
+Title: lnx_distro: SLES based systems have now an OS name inventorized\
+Level: 1
+Component: inv
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.9i1
+Date: 1456925668
+
+
diff --git a/ChangeLog b/ChangeLog
index 66b7ebe..47a09e7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -103,6 +103,7 @@
HW/SW-Inventory:
* 3192 snmp_extended_info: now inventorizes all physical components of devices which
support the ENTITY-MIB
* 3219 FIX: lnx_distro: Now detecting Oracle VM Server correctly
+ * 3229 FIX: lnx_distro: SLES based systems have now an OS name inventorized\
1.2.8b1:
diff --git a/inventory/lnx_distro b/inventory/lnx_distro
index d647dbe..2cbd73b 100644
--- a/inventory/lnx_distro
+++ b/inventory/lnx_distro
@@ -62,24 +62,30 @@ def inv_lnx_distro(info):
def inv_lnx_parse_suse_release(node, line):
node["type"] = "linux"
node["vendor"] = "SuSE"
+
+ version = line[1].split()[-1]
+
if len(line) == 3:
- version = "%s.%s" % (line[1].split()[-1], line[2].split()[-1])
+ patchlevel = line[2].split()[-1]
else:
- version = "%s.0" % line[1].split()[-1]
- node["version"] = version
- if version == "11.2":
+ patchlevel = "0"
+
+ node["version"] = "%s.%s" % (version, patchlevel)
+ node["name"] = "%s.%s" % (line[0].split('(')[0].strip(),
patchlevel)
+
+ if node["version"] == "11.2":
node["code_name"] = "Emerald"
- elif version == "11.3":
+ elif node["version"] == "11.3":
node["code_name"] = "Teal"
- elif version == "11.4":
+ elif node["version"] == "11.4":
node["code_name"] = "Celadon"
- elif version == "12.1":
+ elif node["version"] == "12.1":
node["code_name"] = "Asparagus"
- elif version == "12.2":
+ elif node["version"] == "12.2":
node["code_name"] = "Mantis"
- elif version == "12.3":
+ elif node["version"] == "12.3":
node["code_name"] = "Darthmouth"
- elif version == "13.1":
+ elif node["version"] == "13.1":
node["code_name"] = "Bottle"