Module: check_mk
Branch: master
Commit: d47cd6d86912d48c44c3a9bd186468f30dc52678
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d47cd6d86912d4…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Mon May 5 16:09:41 2014 +0200
lnx_distro: Now able to detect SuSE distributions
The software inventory is now able to detect SuSE distributions and its codenames.
---
.werks/913 | 8 ++++++++
ChangeLog | 1 +
inventory/lnx_distro | 24 ++++++++++++++++++++++++
3 files changed, 33 insertions(+)
diff --git a/.werks/913 b/.werks/913
new file mode 100644
index 0000000..42f279f
--- /dev/null
+++ b/.werks/913
@@ -0,0 +1,8 @@
+Title: lnx_distro: Now able to detect SuSE distributions
+Level: 1
+Component: inv
+Version: 1.2.5i3
+Date: 1399298913
+Class: feature
+
+The software inventory is now able to detect SuSE distributions and its codenames.
diff --git a/ChangeLog b/ChangeLog
index 256f1a2..97c0c5c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -107,6 +107,7 @@
* 0831 FIX: table statehist: no longer crashes on TIMEPERIOD TRANSITION entries with
an invalid syntax...
HW/SW-Inventory:
+ * 0913 lnx_distro: Now able to detect SuSE distributions...
* 0886 FIX: Fix exception on non-UTF-8 encoded characters in software list
diff --git a/inventory/lnx_distro b/inventory/lnx_distro
index 9d522ff..e93c490 100644
--- a/inventory/lnx_distro
+++ b/inventory/lnx_distro
@@ -34,6 +34,8 @@
# <<<lnx_distro:sep(124)>>>
# /etc/redhat-release|Red Hat Enterprise Linux Server release 6.5 (Santiago)
+# <<<lnx_distro:sep(124):persist(1399310551)>>>
+# /etc/SuSE-release|SUSE Linux Enterprise Server 11 (x86_64)|VERSION = 11|PATCHLEVEL = 2
def inv_lnx_distro(info):
@@ -45,6 +47,28 @@ def inv_lnx_distro(info):
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:])
+
+def inv_lnx_parse_suse_release(node, line):
+ node["type"] = "linux"
+ node["vendor"] = "SuSE"
+ version = "%s.%s" % (line[1].split()[-1], line[2].split()[-1])
+ node["version"] = version
+ if version == "11.2":
+ node["code_name"] = "Emerald"
+ elif version == "11.3":
+ node["code_name"] = "Teal"
+ elif version == "11.4":
+ node["code_name"] = "Celadon"
+ elif version == "12.1":
+ node["code_name"] = "Asparagus"
+ elif version == "12.2":
+ node["code_name"] = "Mantis"
+ elif version == "12.3":
+ node["code_name"] = "Darthmouth"
+ elif version == "13.1":
+ node["code_name"] = "Bottle"
def inv_lnx_parse_redhat_release(node, line):
node["type"] = "linux"