Module: check_mk
Branch: master
Commit: dd30e8b2678eacdae33e264e95d927374e6a9710
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=dd30e8b2678eac…
Author: Goetz Golla <gg(a)mathias-kettner.de>
Date: Thu Aug 14 11:46:12 2014 +0200
#0643 windows inventory: OS now contains the install date, reg_uninstall now contains the
path
You have to replace the inventory plugin for windows as well as the checks
---
.werks/643 | 9 +++++++++
ChangeLog | 4 ++++
inventory/win_os | 6 +++++-
inventory/win_reg_uninstall | 3 ++-
web/plugins/views/inventory.py | 8 ++++++++
5 files changed, 28 insertions(+), 2 deletions(-)
diff --git a/.werks/643 b/.werks/643
new file mode 100644
index 0000000..a8a30f8
--- /dev/null
+++ b/.werks/643
@@ -0,0 +1,9 @@
+Title: windows inventory: OS now contains the install date, reg_uninstall now contains
the path
+Level: 1
+Component: inv
+Compatible: incomp
+Version: 1.2.5i6
+Date: 1408009410
+Class: feature
+
+You have to replace the inventory plugin for windows as well as the checks
diff --git a/ChangeLog b/ChangeLog
index 1a8592e..3075ccb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -47,6 +47,10 @@
* 1153 FIX: Changed custom user attributes can now be used immediately...
* 0201 FIX: Fixed error message in Rulelist of RBN...
+ HW/SW-Inventory:
+ * 0643 windows inventory: OS now contains the install date, reg_uninstall now
contains the path...
+ NOTE: Please refer to the migration notes!
+
1.2.5i5:
Core & Setup:
diff --git a/inventory/win_os b/inventory/win_os
index 37c4439..e653609 100644
--- a/inventory/win_os
+++ b/inventory/win_os
@@ -31,7 +31,7 @@
def inv_win_os(info):
node = inv_tree("software.os.")
line = info[0]
- if len(line) == 6:
+ if len(line) == 7:
node["name"] = line[1]
node["kernel_version"] = line[2]
if line[3] == "64-Bit":
@@ -39,6 +39,10 @@ def inv_win_os(info):
else:
node["arch"] = "i386"
node["service_pack"] = line[4]+"."+line[5]
+ dat = re.sub("\+\d+","",line[6])
+ tz = int(re.sub("\d{14}.\d{6}","",line[6]))
+ node["install_date"] = int(time.mktime(time.strptime(dat,
"%Y%m%d%H%M%S.%f"))) - tz*60
+
inv_info['win_os'] = {
"inv_function" : inv_win_os,
diff --git a/inventory/win_reg_uninstall b/inventory/win_reg_uninstall
index 022d85d..ecf87f4 100644
--- a/inventory/win_reg_uninstall
+++ b/inventory/win_reg_uninstall
@@ -31,7 +31,7 @@
def inv_win_reg_uninstall(info):
paclist = inv_tree("software.packages:")
for line in info:
- display_name, publisher, path, pacname, version, estimated_size, date = line
+ display_name, publisher, path, pacname, version, estimated_size, date = line
install_date = ""
if len(date) == 8 and re.match("^20", date):
install_date = int(time.mktime(time.strptime(date, "%Y%m%d")))
@@ -43,6 +43,7 @@ def inv_win_reg_uninstall(info):
"summary" : display_name,
"install_date" : install_date,
"size" : estimated_size,
+ "path" : path,
"package_type" : "reg_uninstall",
}
paclist.append(entry)
diff --git a/web/plugins/views/inventory.py b/web/plugins/views/inventory.py
index 9288213..aee64e6 100644
--- a/web/plugins/views/inventory.py
+++ b/web/plugins/views/inventory.py
@@ -244,6 +244,7 @@ inv_filter_info = {
"bytes_rounded" : { "unit" : _("MB"),
"scale" : 1024*1024 },
"hz" : { "unit" : _("MHz"),
"scale" : 1000000 },
"volt" : { "unit" : _("Volt") },
+ "timestamp" : { "unit" : _("secs") },
}
@@ -540,6 +541,12 @@ def inv_paint_volt(volt):
else:
return "", ""
+def inv_paint_timestamp(stamp):
+ if stamp:
+ return "Unix time", "%i" % stamp
+ else:
+ return "", ""
+
inventory_displayhints.update({
"." : { "title" :
_("Inventory") },
".hardware." : { "title" :
_("Hardware"), "icon" : "hardware", },
@@ -598,6 +605,7 @@ inventory_displayhints.update({
".software.os.version" : { "title" :
_("Version"), },
".software.os.vendor" : { "title" :
_("Vendor"), },
".software.os.type" : { "title" :
_("Type"), }, # e.g. "linux"
+ ".software.os,install_date" : { "title" :
_("Install Date"), "paint" : "timestamp" },
".software.os.kernel_version" : { "title" :
_("Kernel Version"), "short" : _("Kernel") },
".software.os.arch" : { "title" :
_("Kernel Architecture"), "short" : _("Architecture") },
".software.os.service_pack" : { "title" :
_("Service Pack"), "short" : _("Service Pack") },