Module: check_mk
Branch: master
Commit: 5338a908b54a4725ce82e1ff48c158aca0d2ddf2
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5338a908b54a47…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue Jan 19 10:14:49 2016 +0100
#2827 FIX win_disks, win_video: now able to detect multiple instances
---
.werks/2827 | 9 +++++++++
ChangeLog | 1 +
inventory/win_disks | 11 +++++++++++
inventory/win_video | 10 ++++++++++
4 files changed, 31 insertions(+)
diff --git a/.werks/2827 b/.werks/2827
new file mode 100644
index 0000000..9156129
--- /dev/null
+++ b/.werks/2827
@@ -0,0 +1,9 @@
+Title: win_disks, win_video: now able to detect multiple instances
+Level: 1
+Component: inv
+Compatible: compat
+Version: 1.2.7i4
+Date: 1453194865
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index fcc2752..3da32c6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -283,6 +283,7 @@
* 2667 FIX: solaris_mem: fix exception in inventory plugin
* 2714 FIX: Fixed visibility of folding arrows by making them dark
* 2439 FIX: solaris_prtdiag: Can now handle Oracle Corporation SUN FIRE X4170 M2
SERVER...
+ * 2827 FIX: win_disks, win_video: now able to detect multiple instances
1.2.7i3:
diff --git a/inventory/win_disks b/inventory/win_disks
index 4a532d6..aa04853 100644
--- a/inventory/win_disks
+++ b/inventory/win_disks
@@ -60,12 +60,23 @@
def inv_win_disks(info):
node = inv_tree("hardware.storage.disks:")
array = {}
+ first_varname = None
+
for line in info:
if len(line) > 2:
line = [ line[0], ":".join(line[1:]) ]
varname, value = line
varname = re.sub(" *","", varname)
value = re.sub("^ ", "", value)
+
+ if first_varname and varname == first_varname:
+ # Looks like we have a new instance
+ node.append(array)
+ array = {}
+
+ if not first_varname:
+ first_varname = varname
+
if varname == "Manufacturer":
array["vendor"] = value
elif varname == "InterfaceType":
diff --git a/inventory/win_video b/inventory/win_video
index d09a7b4..c19b9dc 100644
--- a/inventory/win_video
+++ b/inventory/win_video
@@ -39,12 +39,22 @@
def inv_win_video(info):
node = inv_tree("hardware.video:")
array = {}
+ first_varname = None
for line in info:
if len(line) > 2:
line = [ line[0], ":".join(line[1:]) ]
varname, value = line
varname = re.sub(" *","", varname)
value = re.sub("^ ", "", value)
+
+ if first_varname and varname == first_varname:
+ # Looks like we have a new instance
+ node.append(array)
+ array = {}
+
+ if not first_varname:
+ first_varname = varname
+
if varname == "Name":
array["name"] = value
elif varname == "DriverVersion":