Module: check_mk
Branch: master
Commit: 401b83ed11124698959f5ef0ee42adb4a322ec0a
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=401b83ed111246…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Mar 18 15:31:46 2014 +0100
INV: add scanners for various windows SW sources
---
inventory/win_exefiles | 48 +++++++++++++++++++++++++++++++++++++
inventory/win_reg_uninstall | 48 +++++++++++++++++++++++++++++++++++++
inventory/win_wmi_software | 51 ++++++++++++++++++++++++++++++++++++++++
web/plugins/views/inventory.py | 12 ++++++----
4 files changed, 155 insertions(+), 4 deletions(-)
diff --git a/inventory/win_exefiles b/inventory/win_exefiles
new file mode 100644
index 0000000..dcc0826
--- /dev/null
+++ b/inventory/win_exefiles
@@ -0,0 +1,48 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2013 mk(a)mathias-kettner.de |
+# +------------------------------------------------------------------+
+#
+# This file is part of Check_MK.
+# The official homepage is at http://mathias-kettner.de/check_mk.
+#
+# check_mk is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation in version 2. check_mk is distributed
+# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
+# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE. See the GNU General Public License for more de-
+# ails. You should have received a copy of the GNU General Public
+# License along with GNU Make; see the file COPYING. If not, write
+# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA.
+
+# Example output
+# <<<win_exefiles:sep(124)>>>
+# C:\Program Files\Common Files\Microsoft Shared\MSInfo\msinfo32.exe|378880
+# C:\Program Files\Common Files\Microsoft Shared\OFFICE15\CMigrate.exe|6847704
+# C:\Program Files\Common Files\Microsoft Shared\OFFICE15\MSOXMLED.EXE|217200
+# C:\Program Files\Common Files\Microsoft Shared\OfficeSoftwareProtectionPlatform\OSPPSVC.EXE|5132888
+
+def inv_win_exefiles(info):
+ paclist = inv_tree("software.packages:")
+ for path, size in info:
+ parts = path.split('\\')
+ entry = {
+ "name" : path,
+ "package_type" : "exe",
+ "size" : int(size),
+ }
+ paclist.append(entry)
+
+
+inv_info['win_exefiles'] = {
+ "inv_function" : inv_win_exefiles,
+}
diff --git a/inventory/win_reg_uninstall b/inventory/win_reg_uninstall
new file mode 100644
index 0000000..c437a5e
--- /dev/null
+++ b/inventory/win_reg_uninstall
@@ -0,0 +1,48 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2013 mk(a)mathias-kettner.de |
+# +------------------------------------------------------------------+
+#
+# This file is part of Check_MK.
+# The official homepage is at http://mathias-kettner.de/check_mk.
+#
+# check_mk is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation in version 2. check_mk is distributed
+# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
+# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE. See the GNU General Public License for more de-
+# ails. You should have received a copy of the GNU General Public
+# License along with GNU Make; see the file COPYING. If not, write
+# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA.
+
+# Example output
+# <<<win_reg_uninstall:sep(124)>>>
+# AddressBook
+# AFPL Ghostscript 8.54
+# AFPL Ghostscript Fonts
+# Connection Manager
+# DirectDrawEx
+# F-Secure Anti-Spyware
+
+def inv_win_reg_uninstall(info):
+ paclist = inv_tree("software.packages:")
+ for line in info:
+ entry = {
+ "name" : line[0],
+ "package_type" : "reg_uninstall",
+ }
+ paclist.append(entry)
+
+
+inv_info['win_reg_uninstall'] = {
+ "inv_function" : inv_win_reg_uninstall,
+}
diff --git a/inventory/win_wmi_software b/inventory/win_wmi_software
new file mode 100644
index 0000000..01eb091
--- /dev/null
+++ b/inventory/win_wmi_software
@@ -0,0 +1,51 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2013 mk(a)mathias-kettner.de |
+# +------------------------------------------------------------------+
+#
+# This file is part of Check_MK.
+# The official homepage is at http://mathias-kettner.de/check_mk.
+#
+# check_mk is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation in version 2. check_mk is distributed
+# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
+# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE. See the GNU General Public License for more de-
+# ails. You should have received a copy of the GNU General Public
+# License along with GNU Make; see the file COPYING. If not, write
+# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA.
+
+# Example output
+# <<<win_wmi_software:sep(124)>>>
+# 64 Bit HP CIO Components Installer|Hewlett-Packard|15.2.1
+# Adobe Flash Player 12 ActiveX|Adobe Systems Incorporated|12.0.0.70
+# Microsoft Visio 2010 Interactive Guide DEU|Microsoft|1.2.1
+# Microsoft Outlook 2010 Interactive Guide DEU|Microsoft|1.2.1
+# VMware vSphere Client 4.1|VMware, Inc.|4.1.0.17435
+# Microsoft Office Professional Plus 2010|Microsoft Corporation|14.0.7015.1000
+
+
+def inv_win_wmi_software(info):
+ paclist = inv_tree("software.packages:")
+ for pacname, vendor, version in info:
+ entry = {
+ "name" : pacname,
+ "version" : version,
+ "vendor" : vendor,
+ "package_type" : "wmi",
+ }
+ paclist.append(entry)
+
+
+inv_info['win_wmi_software'] = {
+ "inv_function" : inv_win_wmi_software,
+}
diff --git a/web/plugins/views/inventory.py b/web/plugins/views/inventory.py
index 8343c4c..50531e8 100644
--- a/web/plugins/views/inventory.py
+++ b/web/plugins/views/inventory.py
@@ -503,11 +503,14 @@ def inv_paint_bytes(b):
return "number", "%d %s" % (b, units[i])
def inv_paint_count(b):
- return "number", str(b)
+ if b == None:
+ return "", ""
+ else:
+ return "number", str(b)
def inv_paint_bytes_rounded(b):
if b == None:
- return "", _("unknown")
+ return "", ""
elif b == 0:
return "number", "0"
@@ -519,9 +522,9 @@ def inv_paint_bytes_rounded(b):
fac = fac / 1024.0
if i:
- return "number", "%.2f %s" % (b / fac, units[i])
+ return "number", "%.2f %s" % (b / fac, units[i])
else:
- return "number", "%d %s" % (b, units[0])
+ return "number", "%d %s" % (b, units[0])
def inv_paint_volt(volt):
return "number", "%.1f V" % volt
@@ -568,6 +571,7 @@ inventory_displayhints.update({
".software.packages:*.summary" : { "title" : _("Description"), },
".software.packages:*.version" : { "title" : _("Version"), },
".software.packages:*.package_version" : { "title" : _("Package Version"), },
+ ".software.packages:*.size" : { "title" : _("Size"), "paint" : "count" },
})
# TEST: create painters for node with a display hint
Module: check_mk
Branch: master
Commit: 8d501436171ccd54a120efff90cc707428d0c785
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8d501436171ccd…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Mar 18 11:21:36 2014 +0100
RBN: Fix exception when a user is saving a new rule
---
web/htdocs/wato.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index f4784eb..bc9cf2f 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -257,7 +257,7 @@ def page_handler():
html.set_var("mode", newmode) # will be used by makeuri
# Check general permissions for the new mode
- if not config.may("wato.seeall"):
+ if modeperms != None and not config.may("wato.seeall"):
for pname in modeperms:
if '.' not in pname:
pname = "wato." + pname
Module: check_mk
Branch: master
Commit: babfd065300b0a242f6e779a33403b77d835724c
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=babfd065300b0a…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Mar 17 17:33:06 2014 +0100
BI aggregates now acknowledgement information
Check_MK BI now also aggregates the information wether problems that make the aggregate
non-OK are acknowledged. Please refer to the updated <a href="checkmk_bi.html">documentation
about BI</a> for details.
---
.werks/715 | 11 +++++++++++
ChangeLog | 1 +
web/htdocs/bi.py | 24 ++++++++++++++++++++++--
web/plugins/views/bi.py | 2 ++
4 files changed, 36 insertions(+), 2 deletions(-)
diff --git a/.werks/715 b/.werks/715
new file mode 100644
index 0000000..e15fb26
--- /dev/null
+++ b/.werks/715
@@ -0,0 +1,11 @@
+Title: BI aggregates now acknowledgement information
+Level: 2
+Component: bi
+Version: 1.2.5i1
+Date: 1395073928
+Class: feature
+
+Check_MK BI now also aggregates the information wether problems that make the aggregate
+non-OK are acknowledged. Please refer to the updated <a href="checkmk_bi.html">documentation
+about BI</a> for details.
+
diff --git a/ChangeLog b/ChangeLog
index b962247..0037d89 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -334,6 +334,7 @@
BI:
* 0721 Use hard states in BI aggregates...
* 0714 BI aggregations now also honor scheduled downtimes...
+ * 0715 BI aggregates now acknowledgement information...
* 0669 FIX: Fixed regex matching in BI when using character groups [...]...
Reporting & Availability:
diff --git a/web/htdocs/bi.py b/web/htdocs/bi.py
index 8fda93a..aac8a89 100644
--- a/web/htdocs/bi.py
+++ b/web/htdocs/bi.py
@@ -1107,13 +1107,22 @@ def execute_rule_node(node, status_info, use_hard_states):
node_states = []
assumed_states = []
downtime_states = []
+ ack_states = [] # Needed for computing the acknowledgement of non-OK nodes
one_assumption = False
for n in node["nodes"]:
result = execute_node(n, status_info, use_hard_states) # state, assumed_state, node [, subtrees]
subtrees.append(result)
- # Assume items in downtime as CRIT
+
+ # Assume items in downtime as CRIT when computing downtime state
downtime_states.append(({"state": result[0]["in_downtime"] and 2 or 0, "output" : ""}, result[2]))
+ # Assume non-OK nodes that are acked as OK
+ if result[0]["acknowledged"]:
+ acked_state = 0
+ else:
+ acked_state = result[0]["state"]
+ ack_states.append(({"state": acked_state, "output" : ""}, result[2]))
+
node_states.append((result[0], result[2]))
if result[1] != None:
assumed_states.append((result[1], result[2]))
@@ -1125,9 +1134,16 @@ def execute_rule_node(node, status_info, use_hard_states):
downtime_state = func(*([downtime_states] + funcargs))
state = func(*([node_states] + funcargs))
state["in_downtime"] = downtime_state["state"] >= 2
+ if state["state"] > 0: # Non-OK-State -> compute acknowledgedment
+ ack_state = func(*([ack_states] + funcargs))
+ state["acknowledged"] = ack_state["state"] == 0 # would be OK if acked problems would be OK
+ else:
+ state["acknowledged"] = False
+
if one_assumption:
assumed_state = func(*([assumed_states] + funcargs))
assumed_state["in_downtime"] = state["in_downtime"]
+ assumed_state["acknowledged"] = state["acknowledged"]
else:
assumed_state = None
return (state, assumed_state, node, subtrees)
@@ -1529,7 +1545,7 @@ def render_tree_foldable(row, boxes, omit_root, expansion_level, only_problems,
return "aggrtree" + (boxes and "_box" or ""), htmlcode
def aggr_render_node(tree, title, mousecode, show_host):
-
+
# Check if we have an assumed state: comparing assumed state (tree[1]) with state (tree[0])
if tree[1] and tree[0] != tree[1]:
addclass = " " + _("assumed")
@@ -1542,6 +1558,10 @@ def aggr_render_node(tree, title, mousecode, show_host):
title = ('<img class="icon bi" src="images/icon_downtime.png" title="%s">' % \
_("This element is currently in a scheduled downtime")) + title
+ if tree[0]["acknowledged"]:
+ title = ('<img class="icon bi" src="images/icon_ack.png" title="%s">' % \
+ _("This problem has been acknowledged")) + title
+
h = '<span class="content state state%d%s">%s</span>\n' \
% (effective_state["state"], addclass, render_bi_state(effective_state["state"]))
if mousecode:
diff --git a/web/plugins/views/bi.py b/web/plugins/views/bi.py
index 9a89b2c..a335f1c 100644
--- a/web/plugins/views/bi.py
+++ b/web/plugins/views/bi.py
@@ -80,6 +80,8 @@ def paint_bi_icons(row):
html.icon_button(avail_url, _("Analyse availability of this aggregation"), "availability")
if row["aggr_effective_state"]["in_downtime"]:
html.icon(_("This aggregation is currently in a scheduled downtime"), "downtime")
+ if row["aggr_effective_state"]["acknowledged"]:
+ html.icon(_("The critical problems that make this aggregation non-OK have been acknowledged"), "ack")
code = html.drain()
html.unplug()
return "buttons", code
Module: check_mk
Branch: master
Commit: 7075b91027a8a9be530ca9c6efe7b42f89d55895
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7075b91027a8a9…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Mar 17 17:10:47 2014 +0100
BI aggregations now also honor scheduled downtimes
A BI aggregate now also aggregates the additional information wether it is
in a scheduled downtime or not. Please refer to the updated <a href="checkmk_bi.html">documentation
about BI</a> for details.
---
.werks/714 | 10 ++++++
ChangeLog | 1 +
web/htdocs/bi.css | 9 ++++-
web/htdocs/bi.py | 71 ++++++++++++++++++++++++++++++-------
web/plugins/views/availability.py | 25 +++++++++----
web/plugins/views/bi.py | 4 ++-
6 files changed, 100 insertions(+), 20 deletions(-)
Diff: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=7075b91027…