Module: check_mk
Branch: master
Commit: 820b7070149faae2e94ddd87ff7d6ba4dbb8845c
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=820b7070149faa…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon May 11 12:52:17 2015 +0200
Matrix layout: hilite cells if value differs from majority
---
.werks/2228 | 5 +++++
web/htdocs/views.css | 7 ++++++
web/plugins/views/layouts.py | 49 +++++++++++++++++++++++++++++++++++++-----
3 files changed, 56 insertions(+), 5 deletions(-)
diff --git a/.werks/2228 b/.werks/2228
index 3de2b19..82e2281 100644
--- a/.werks/2228
+++ b/.werks/2228
@@ -17,3 +17,8 @@ This new layout has been used to create two new views: a global view <i>Search
performance data</i> in the topic <i>Metrics</i> and one that can be accessed
in the details of a host group. Both show all services of the selected hosts
of of the search in a host by services matrix. Simply try it out!
+
+If one line in a matrix view has the same value for a majority of entries
+then all entries with differing values will be hilighted. That way you can
+use the matrix layout in order to find configuration differences between
+the same service on different hosts.
diff --git a/web/htdocs/views.css b/web/htdocs/views.css
index ed32cf1..69a0bc1 100644
--- a/web/htdocs/views.css
+++ b/web/htdocs/views.css
@@ -416,6 +416,13 @@ table.data.matrix tr.matrixhead td.left {
color: white;
}
+table.data.matrix tr.even0 td.minority {
+ background-color: #cff;
+}
+table.data.matrix tr.odd0 td.minority {
+ background-color: #dff;
+}
+
table.data.single td.gap {
background-color: transparent;
diff --git a/web/plugins/views/layouts.py b/web/plugins/views/layouts.py
index 25a69c3..43cfe49 100644
--- a/web/plugins/views/layouts.py
+++ b/web/plugins/views/layouts.py
@@ -520,6 +520,8 @@ multisite_layouts["table"] = {
def render_matrix(rows, view, group_painters, painters, num_columns, _ignore_show_checkboxes):
+ majorities = matrix_find_majorities(rows, group_painters, painters)
+
for groups, unique_row_ids, matrix_cells in \
create_matrices(rows, group_painters, painters, num_columns):
@@ -549,20 +551,57 @@ def render_matrix(rows, view, group_painters, painters, num_columns, _ignore_sho
if cell_row == None:
html.write("<td></td>")
else:
- if len(painters) == 2:
- paint(painters[1], cell_row)
- else:
+ if len(painters) > 2:
html.write("<td class=cell><table>")
- for p in painters[1:]:
+ for painter_nr, p in enumerate(painters[1:]):
+ tdclass, content = prepare_paint(p, cell_row)
+ gv = group_value(cell_row, [p])[0]
+ majority_value = majorities[row_id].get(painter_nr, None)
+ if majority_value != None and majority_value != gv:
+ tdclass += " minority"
+ if len(painters) > 2:
html.write("<tr>")
- paint(p, cell_row)
+ html.write('<td class="%s">%s</td>' % (tdclass, content))
+ if len(painters) > 2:
html.write("</tr>")
+ if len(painters) > 2:
html.write("</table></td>")
html.write('</tr>')
html.write("</table>")
+def matrix_find_majorities(rows, group_painters, painters):
+ counts = {} # dict row_id -> painter_nr -> value -> count
+
+ for row in rows:
+ group_id = tuple(group_value(row, group_painters))
+ row_id = tuple(group_value(row, [ painters[0] ]))
+ for painter_nr, painter in enumerate(painters[1:]):
+ value = group_value(row, [painter])[0]
+ row_entry = counts.setdefault(row_id, {})
+ painter_entry = row_entry.setdefault(painter_nr, {})
+ painter_entry.setdefault(value, 0)
+ painter_entry[value] += 1
+
+ # Now find majorities for each row
+ majorities = {} # row_id -> painter_nr -> majority value
+ for row_id, row_entry in counts.items():
+ maj_entry = majorities.setdefault(row_id, {})
+ for painter_nr, painter_entry in row_entry.items():
+ maj_value = None
+ max_count = 0
+ for value, count in painter_entry.items():
+ if count == max_count:
+ maj_value = None # No majority
+ elif count > max_count and count >= 2:
+ maj_value = value
+ max_count = count
+ maj_entry[painter_nr] = maj_value
+
+
+ return majorities
+
# Create list of matrices to render
def create_matrices(rows, group_painters, painters, num_columns):
Module: check_mk
Branch: master
Commit: 9b021956d97465d56b9d1b75234610a4a086a0e7
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9b021956d97465…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon May 11 11:42:10 2015 +0200
Small internal code change in new matrix layout
---
web/plugins/views/layouts.py | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/web/plugins/views/layouts.py b/web/plugins/views/layouts.py
index b05d571..25a69c3 100644
--- a/web/plugins/views/layouts.py
+++ b/web/plugins/views/layouts.py
@@ -100,6 +100,7 @@ def render_single_dataset(rows, view, group_painters, painters, num_columns, _ig
html.write("</table>\n")
html.write("</div>\n")
+
multisite_layouts["dataset"] = {
"title" : _("Single dataset"),
"render" : render_single_dataset,
@@ -519,12 +520,6 @@ multisite_layouts["table"] = {
def render_matrix(rows, view, group_painters, painters, num_columns, _ignore_show_checkboxes):
- if len(painters) < 2:
- raise MKGeneralException(_("Cannot display this view in matrix layout. You need at least two columns!"))
-
- if not group_painters:
- raise MKGeneralException(_("Cannot display this view in matrix layout. You need at least one group column!"))
-
for groups, unique_row_ids, matrix_cells in \
create_matrices(rows, group_painters, painters, num_columns):
@@ -571,6 +566,12 @@ def render_matrix(rows, view, group_painters, painters, num_columns, _ignore_sho
# Create list of matrices to render
def create_matrices(rows, group_painters, painters, num_columns):
+ if len(painters) < 2:
+ raise MKGeneralException(_("Cannot display this view in matrix layout. You need at least two columns!"))
+
+ if not group_painters:
+ raise MKGeneralException(_("Cannot display this view in matrix layout. You need at least one group column!"))
+
# First find the groups - all rows that have the same values for
# all group columns. Usually these should correspond with the hosts
# in the matrix
Module: check_mk
Branch: master
Commit: 578eb89a04480f14170482a725b01703822148f2
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=578eb89a04480f…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Mon May 11 10:37:50 2015 +0200
#2267 FIX mk_db2.aix agent plugin: no longer throws an error when a db2 profile is not set up properly
An invalid set up instance will be skipped.
---
.werks/2267 | 9 +++++++++
ChangeLog | 1 +
agents/plugins/mk_db2.aix | 8 +++++++-
3 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/.werks/2267 b/.werks/2267
new file mode 100644
index 0000000..846160e
--- /dev/null
+++ b/.werks/2267
@@ -0,0 +1,9 @@
+Title: mk_db2.aix agent plugin: no longer throws an error when a db2 profile is not set up properly
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i1
+Date: 1431333222
+Class: fix
+
+An invalid set up instance will be skipped.
diff --git a/ChangeLog b/ChangeLog
index 82eb071..1ff75a4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -358,6 +358,7 @@
* 1245 FIX: printer_output: Now correctly detect a bin with unknown as name
* 2265 FIX: db2_version: improved check output when version information is missing...
* 2266 FIX: windows agent: fixed invalid agent output if system memory exceeds 2TB RAM...
+ * 2267 FIX: mk_db2.aix agent plugin: no longer throws an error when a db2 profile is not set up properly...
Multisite:
* 1758 Improved exception hander: Shows details without additional debug request, added mailto link for error report...
diff --git a/agents/plugins/mk_db2.aix b/agents/plugins/mk_db2.aix
index 26f962a..fd47b35 100755
--- a/agents/plugins/mk_db2.aix
+++ b/agents/plugins/mk_db2.aix
@@ -61,7 +61,13 @@ function query_instances {
waitmax 20 << WAITMAX
su $INSTANCE << EOF
- . $HOMEDIR/sqllib/db2profile 2>&1 > /dev/null;
+
+ if [ ! -f $HOMEDIR/sqllib/db2profile ] ;
+ then
+ exit 0
+ fi
+
+ . $HOMEDIR/sqllib/db2profile >/dev/null 2>&1 ;
function compare_version_greater_equal {
Module: check_mk
Branch: master
Commit: 0db3a2041945b24b6ad5baa23fe244ca295d7cbb
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0db3a2041945b2…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon May 11 09:12:23 2015 +0200
#2253 FIX Availability context button is now visible again for host- and servicegroups
---
.werks/2253 | 10 ++++++++++
ChangeLog | 1 +
web/htdocs/views.py | 6 ++----
3 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/.werks/2253 b/.werks/2253
new file mode 100644
index 0000000..5bb8ae1
--- /dev/null
+++ b/.werks/2253
@@ -0,0 +1,10 @@
+Title: Availability context button is now visible again for host- and servicegroups
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1431328321
+
+
diff --git a/ChangeLog b/ChangeLog
index 348cd5d..82eb071 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -431,6 +431,7 @@
* 2233 FIX: Fixed WATO folder view and Host Tags search with HTML Entity encoding...
* 2074 FIX: pnptemplate netapp_api_volume: fixed title
* 2251 FIX: Adding views to dashboards / reports is now respecing all set filters...
+ * 2253 FIX: Availability context button is now visible again for host- and servicegroups
WATO:
* 1760 Added search form to manual checks page
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index 8ab1507..7706710 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -1166,10 +1166,8 @@ def render_view(view, rows, datasource, group_painters, painters,
row_count > 0 and command_form,
# Take into account: layout capabilities
can_display_checkboxes and not view.get("force_checkboxes"), show_checkboxes,
- # Show link to availability. This exists only for plain hosts
- # and services table. The grouping tables have columns that statehist
- # is missing. That way some of the filters might fail.
- datasource["table"] in [ "hosts", "services", ] or "aggr" in datasource["infos"])
+ # Show link to availability
+ "host" in datasource["infos"] or "service" in datasource["infos"] or "aggr" in datasource["infos"])
# User errors in filters
html.show_user_errors()
Module: check_mk
Branch: master
Commit: 4930d37b80f8b3de49735f1e381c6d6ad0bcdcb6
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4930d37b80f8b3…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri May 8 16:08:07 2015 +0200
#2228 New matrix views for displaying performance data of service in a matrix table
Multisite has got a new layout: the <i>Matrix</i>. It allows to group and
compare values of a similar set of services on a list of hosts and many
other things. This layout uses the group columns for creating vertical
matrix columns (e.g. the host name) and the first normal column for creating
horizontal columns (e.g. the service description). All further columns
(most times just one) are displayed in the cells.
This new layout has been used to create two new views: a global view <i>Search
performance data</i> in the topic <i>Metrics</i> and one that can be accessed
in the details of a host group. Both show all services of the selected hosts
of of the search in a host by services matrix. Simply try it out!
---
.werks/2228 | 19 ++++
ChangeLog | 1 +
web/htdocs/images/icons/matrix.png | Bin 0 -> 1918 bytes
web/htdocs/views.css | 41 ++++++++
web/plugins/config/builtin.py | 2 +-
web/plugins/views/builtin.py | 94 +++++++++++++++++
web/plugins/views/layouts.py | 201 ++++++++++++++++++++++++++++++------
web/plugins/views/painters.py | 3 +
8 files changed, 328 insertions(+), 33 deletions(-)
Diff: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=4930d37b80…