Module: check_mk
Branch: master
Commit: 4f9081911f9b59728ca54a67770c27bed87b2c22
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4f9081911f9b59…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Dec 2 14:07:05 2014 +0100
#1584 FIX winperf_if: Fixed checks of interfaces with equal names but one with index
When having interfaces with nearly equal names, where the only difference is that
one has an index number as extension and the other has none, the check could not
get the correct information during checking. Example:
Intel[R] 82576 Gigabit Dual Port Network Connection 2
Intel[R] 82576 Gigabit Dual Port Network Connection
---
.bugs/1065 | 7 +++++--
.bugs/1088 | 7 +++++--
.bugs/842 | 6 +++---
.bugs/845 | 23 +++++++++++++----------
.werks/1584 | 14 ++++++++++++++
ChangeLog | 1 +
checks/winperf_if | 2 +-
7 files changed, 42 insertions(+), 18 deletions(-)
diff --git a/.bugs/1065 b/.bugs/1065
index c27611d..d216413 100644
--- a/.bugs/1065
+++ b/.bugs/1065
@@ -1,9 +1,9 @@
Title: objects.precache missing on first start
Component: core
-State: open
+Class: bug
+State: works4me
Date: 2014-03-24 13:28:13
Targetversion: 1.2.5i1
-Class: bug
creating a new site with
omd create blubb
@@ -25,3 +25,6 @@ Error: Cannot open config file '/omd/sites/blubb/var/nagios/objects.precache' fo
after a
cmk -R
nagios starts... :-(
+
+2014-12-02 12:35:57: changed state open -> works4me
+Unable to reproduce this problem.
diff --git a/.bugs/1088 b/.bugs/1088
index 401d001..2bb5121 100644
--- a/.bugs/1088
+++ b/.bugs/1088
@@ -1,9 +1,12 @@
Title: Keepalive mode adds multiple --keepalive-fd=__ as time goes by
Component: core
-State: open
+Class: nastiness
+State: done
Date: 2014-01-24 16:57:53
Targetversion: 1.2.5i1
-Class: nastiness
It seems that after each config reload one --keepalive-fd=7 is added to the command line.
The Check_MK should remove this option when adding new one.
+
+2014-12-02 12:38:01: changed state open -> done
+Is already fixed.
diff --git a/.bugs/842 b/.bugs/842
index 52d4d2e..d47079d 100644
--- a/.bugs/842
+++ b/.bugs/842
@@ -1,9 +1,9 @@
-Title: HW/SW Inventory should not be appear on Clusters or some Special Agents
-Component: inv
+Title: Make host class (ALL_HOSTS, PHYSICAL_HOSTS, CLUSTER_HOSTS) available in WATO conditions
+Component: wato
State: open
Date: 2014-04-16 09:35:42
Targetversion: 1.2.5i1
-Class: bug
+Class: feature
In Wato there is no option like PHYSICAL_HOSTS or CLUSTER_HOSTS so there should be a easy way to deactivate the HW/SW Inventory check using Wato for clusters.
If you have a big enviroment it is not fine solution to click through a couple of folders to find all clusters an add a Cluster Tag.
diff --git a/.bugs/845 b/.bugs/845
index 086c492..b269c44 100644
--- a/.bugs/845
+++ b/.bugs/845
@@ -1,21 +1,18 @@
Title: Interface Check: In some cases the check use information of the wrong interface
Component: checks
-State: open
+Class: bug
+State: done
Date: 2014-11-21 14:45:22
Targetversion: 1.2.5i1
-Class: bug
-In some cases the condition in check_if_common who trys to find the right item matchs to early if there two interfaces have the same
-name, but in one case with a number an in the other without but with the same interace index. See the following agent output:
+In some cases the condition in check_if_common who trys to find the right item
+matchs to early if there two interfaces have the same name, but in one case
+with a number and in the other without but with the same interface index.
+See the following agent output:
<<<winperf_if>>>
1416471728.39 510
-6 instances: Intel[R]_82576_Gigabit_Dual_Port_Network_Connection Intel
-[R]_82576_Gigabit_Dual_Port_Network_Connection__2 Intel[R]_PRO_
-1000_PT_Dual_Port_Server_Adapter Intel
-[R]_PRO_1000_PT_Dual_Port_Server_Adapter__2
-isatap.{76FCB5A2-8B81-4EC1-A917-7BB6004938B9} 6TO4_
-Adapter
+6 instances: Intel[R]_82576_Gigabit_Dual_Port_Network_Connection Intel[R]_82576_Gigabit_Dual_Port_Network_Connection__2 Intel[R]_PRO_1000_PT_Dual_Port_Server_Adapter Intel[R]_PRO_1000_PT_Dual_Port_Server_Adapter__2 isatap.{76FCB5A2-8B81-4EC1-A917-7BB6004938B9} 6TO4_Adapter
-122 3152470526 0 0 0 0 3209053651 bulk_count
-110 90473997 0 0 0 0 46660432 bulk_count
-244 72853543 0 0 0 0 35395085 bulk_count
@@ -34,3 +31,9 @@ Adapter
32 0 0 0 0 0 0 large_rawcount
34 0 0 0 0 0 0 large_rawcount
1086 0 0 0 0 0 0 large_rawcount
+
+Intel[R] 82576 Gigabit Dual Port Network Connection 2
+Intel[R] 82576 Gigabit Dual Port Network Connection
+
+2014-12-02 14:04:52: changed state open -> done
+Fixed by changing internal sorting of interfaces in winperf_if check
diff --git a/.werks/1584 b/.werks/1584
new file mode 100644
index 0000000..4bc970a
--- /dev/null
+++ b/.werks/1584
@@ -0,0 +1,14 @@
+Title: winperf_if: Fixed checks of interfaces with equal names but one with index
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.5i7
+Date: 1417525531
+Class: fix
+
+When having interfaces with nearly equal names, where the only difference is that
+one has an index number as extension and the other has none, the check could not
+get the correct information during checking. Example:
+
+Intel[R] 82576 Gigabit Dual Port Network Connection 2
+Intel[R] 82576 Gigabit Dual Port Network Connection
diff --git a/ChangeLog b/ChangeLog
index 46bac54..ba88009 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -53,6 +53,7 @@
* 1550 FIX: zfs_arc_cache: do not inventorize of no cache information available...
* 1572 FIX: Sample configs, plugins etc. for windows agent use windows linebreaks now...
* 1575 FIX: vSphere Monitoring works with RedHat 5.x now...
+ * 1584 FIX: winperf_if: Fixed checks of interfaces with equal names but one with index...
Multisite:
* 1508 Allow input of plugin output and perfdata when faking check results...
diff --git a/checks/winperf_if b/checks/winperf_if
index 03438c8..33d7117 100644
--- a/checks/winperf_if
+++ b/checks/winperf_if
@@ -152,7 +152,7 @@ def convert_winperf_if(info):
# Sort NIC names are create artifical index
nic_names = nics.keys()
- nic_names.sort()
+ nic_names.sort(reverse=True)
for nr, nic_name in enumerate(nic_names):
nic = nics[nic_name]
Module: check_mk
Branch: master
Commit: 7caec0c6122b4be1a96f6c0f26d3126ff70a44fd
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7caec0c6122b4b…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Dec 2 10:11:07 2014 +0100
Revert "#1579 FIX Views: Setting for hard coded single context filters can now be changed by URL and filter"
This reverts commit fc066d9e86eec81c882c709b4f7a7cbea8efc156.
---
.werks/1579 | 11 -----------
ChangeLog | 1 -
web/htdocs/visuals.py | 6 +++---
3 files changed, 3 insertions(+), 15 deletions(-)
diff --git a/.werks/1579 b/.werks/1579
deleted file mode 100644
index 3ac34ce..0000000
--- a/.werks/1579
+++ /dev/null
@@ -1,11 +0,0 @@
-Title: Views: Setting for hard coded single context filters can now be changed by URL and filter
-Level: 1
-Component: multisite
-Compatible: compat
-Version: 1.2.5i7
-Date: 1417510947
-Class: fix
-
-When a view has a hard coded value for a single context filter, the value could
-not be changed by the user when watching a view, neither by URL nor filter form.
-This has been changed now to make it possible to override the default value.
diff --git a/ChangeLog b/ChangeLog
index b6f4c24..5d7e4e5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -91,7 +91,6 @@
* 1557 FIX: Fix sorting of hostnames that only differ in lower/uppercaseness
* 1577 FIX: Fixed editing of views using the "Downtime for host/service" sorter or column...
* 1578 FIX: Folding states of containers with umlauts in titles are now persisted...
- * 1579 FIX: Views: Setting for hard coded single context filters can now be changed by URL and filter...
WATO:
* 1170 Added buttons to move rules to top/bottom of the list to ruleset edit dialog
diff --git a/web/htdocs/visuals.py b/web/htdocs/visuals.py
index 5185dfc..f7115a7 100644
--- a/web/htdocs/visuals.py
+++ b/web/htdocs/visuals.py
@@ -903,10 +903,10 @@ def add_context_to_uri_vars(visual, only_infos=None, only_count=False):
only_infos = infos.keys() # all datasources!
# Populate the HTML vars with missing context vars. The context vars set
- # in single context are not enforced (they can be overwritten by URL or by
- # changing the filter form).
+ # in single context are enforced (can not be overwritten by URL). The normal
+ # filter vars in "multiple" context are not enforced.
for key in get_single_info_keys(visual):
- if key in visual['context'] and not html.has_var(key):
+ if key in visual['context']:
html.set_var(key, visual['context'][key])
# Now apply the multiple context filters
Module: check_mk
Branch: master
Commit: 2aa2d805e4d5dc638eb1176ea49499a89a8878c9
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2aa2d805e4d5dc…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Dec 2 10:36:24 2014 +0100
#1580 FIX Views: Hardcoded single context filters are not shown in filter form anymore
When a view has a single context and the value of the filters hard coded in the view,
the filter elements are not shown to the user in the filter form anymore.
---
.werks/1580 | 10 ++++++++++
ChangeLog | 1 +
web/htdocs/views.py | 10 +++++++---
web/htdocs/visuals.py | 31 +++++++++++++++++++++++--------
web/plugins/dashboard/dashlets.py | 4 ++--
5 files changed, 43 insertions(+), 13 deletions(-)
diff --git a/.werks/1580 b/.werks/1580
new file mode 100644
index 0000000..0a6c0f4
--- /dev/null
+++ b/.werks/1580
@@ -0,0 +1,10 @@
+Title: Views: Hardcoded single context filters are not shown in filter form anymore
+Level: 1
+Component: multisite
+Compatible: compat
+Version: 1.2.5i7
+Date: 1417512923
+Class: fix
+
+When a view has a single context and the value of the filters hard coded in the view,
+the filter elements are not shown to the user in the filter form anymore.
diff --git a/ChangeLog b/ChangeLog
index 5d7e4e5..e0e9bf7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -91,6 +91,7 @@
* 1557 FIX: Fix sorting of hostnames that only differ in lower/uppercaseness
* 1577 FIX: Fixed editing of views using the "Downtime for host/service" sorter or column...
* 1578 FIX: Folding states of containers with umlauts in titles are now persisted...
+ * 1580 FIX: Views: Hardcoded single context filters are not shown in filter form anymore...
WATO:
* 1170 Added buttons to move rules to top/bottom of the list to ruleset edit dialog
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index e330b32..3e6745e 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -930,10 +930,14 @@ def show_view(view, show_heading = False, show_buttons = True,
datasource = multisite_datasources[view["datasource"]]
tablename = datasource["table"]
- # Filters to show in the view
+ # Filters to use in the view
# In case of single object views, the needed filters are fixed, but not always present
# in context. In this case, take them from the context type definition.
- show_filters = visuals.show_filters(view, datasource['infos'], all_filters_active)
+ use_filters = visuals.filters_of_visual(view, datasource['infos'], all_filters_active)
+
+ # Not all filters are really shown later in show_filter_form(), because filters which
+ # have a hardcoded value are not changeable by the user
+ show_filters = visuals.visible_filters_of_visual(view, use_filters)
visuals.add_context_to_uri_vars(view, datasource["infos"], only_count)
@@ -944,7 +948,7 @@ def show_view(view, show_heading = False, show_buttons = True,
# Prepare Filter headers for Livestatus
filterheaders = ""
only_sites = None
- all_active_filters = [ f for f in show_filters if f.available() ]
+ all_active_filters = [ f for f in use_filters if f.available() ]
for filt in all_active_filters:
header = filt.filter(tablename)
if header.startswith("Sites:"):
diff --git a/web/htdocs/visuals.py b/web/htdocs/visuals.py
index f7115a7..0fd8a81 100644
--- a/web/htdocs/visuals.py
+++ b/web/htdocs/visuals.py
@@ -869,22 +869,22 @@ def filters_allowed_for_info(info):
allowed[fname] = filt
return allowed
-# Collects all filters to be shown for the given visual
-def show_filters(visual, info_keys, show_all=False):
- show_filters = []
+# Collects all filters to be used for the given visual
+def filters_of_visual(visual, info_keys, show_all=False):
+ filters = []
for info_key in info_keys:
if info_key in visual['single_infos']:
for key in info_params(info_key):
- show_filters.append(get_filter(key))
+ filters.append(get_filter(key))
elif not show_all:
for key, val in visual['context'].items():
if type(val) == dict: # this is a real filter
- show_filters.append(get_filter(key))
+ filters.append(get_filter(key))
if show_all: # add *all* available filters of these infos
for filter_name, filter in multisite_filters.items():
if filter.info in info_keys:
- show_filters.append(filter)
+ filters.append(filter)
# add ubiquitary_filters that are possible for these infos
for fn in ubiquitary_filters:
@@ -893,10 +893,25 @@ def show_filters(visual, info_keys, show_all=False):
continue
filter = get_filter(fn)
if not filter.info or filter.info in info_keys:
- show_filters.append(filter)
+ filters.append(filter)
+
+ return list(set(filters)) # remove duplicates
+
+# Reduces the list of the visuals used filters. The result are the ones
+# which are really presented to the user later.
+# For the moment we only remove the single context filters which have a
+# hard coded default value which is treated as enforced value.
+def visible_filters_of_visual(visual, use_filters):
+ show_filters = []
+
+ single_keys = get_single_info_keys(visual)
- return list(set(show_filters)) # remove duplicates
+ for f in use_filters:
+ if f.name not in single_keys or \
+ not visual['context'].get(f.name):
+ show_filters.append(f)
+ return show_filters
def add_context_to_uri_vars(visual, only_infos=None, only_count=False):
if only_infos == None:
diff --git a/web/plugins/dashboard/dashlets.py b/web/plugins/dashboard/dashlets.py
index 34685fb..5ed326b 100644
--- a/web/plugins/dashboard/dashlets.py
+++ b/web/plugins/dashboard/dashlets.py
@@ -209,8 +209,8 @@ def render_statistics(pie_id, what, table, filter, dashlet):
pie_right_aspect = 0.8
info = what == 'hosts' and 'host' or 'service'
- show_filters = visuals.show_filters(dashlet, [info])
- for filt in show_filters:
+ use_filters = visuals.filters_of_visual(dashlet, [info])
+ for filt in use_filters:
if filt.available():
filter += filt.filter(info)
Module: check_mk
Branch: master
Commit: be846756858a7c34d62d1b9962c006e1691eb124
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=be846756858a7c…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Dec 2 10:51:42 2014 +0100
#1581 FIX Single context views with missing context show an error message now
When views which have a single context defined but are missing needed
context information (not hard coded, not provided per URL) are opened,
they show an error message about the missing context now.
---
.bugs/2160 | 7 +++++--
.werks/1581 | 12 ++++++++++++
ChangeLog | 1 +
web/htdocs/views.py | 8 ++++++++
web/htdocs/visuals.py | 7 +++++++
5 files changed, 33 insertions(+), 2 deletions(-)
diff --git a/.bugs/2160 b/.bugs/2160
index 9ab473d..b9f0b8e 100644
--- a/.bugs/2160
+++ b/.bugs/2160
@@ -1,10 +1,13 @@
Title: Visuals: when single-context views are shown without context, show proper error
Component: multisite
-State: open
+Class: bug
+State: done
Date: 2014-09-02 12:18:00
Targetversion: future
-Class: bug
In the table of all views, a single-context view should either not be clickable
(except it has its context hard coded). Also we should display a useful error
if the view is being called directly via URL.
+
+2014-12-02 10:50:14: changed state open -> done
+Fixed.
diff --git a/.werks/1581 b/.werks/1581
new file mode 100644
index 0000000..a1d853a
--- /dev/null
+++ b/.werks/1581
@@ -0,0 +1,12 @@
+Title: Single context views with missing context show an error message now
+Level: 1
+Component: multisite
+Compatible: compat
+Version: 1.2.5i7
+Date: 1417513817
+Class: fix
+
+When views which have a single context defined but are missing needed
+context information (not hard coded, not provided per URL) are opened,
+they show an error message about the missing context now.
+
diff --git a/ChangeLog b/ChangeLog
index e0e9bf7..3481d36 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -92,6 +92,7 @@
* 1577 FIX: Fixed editing of views using the "Downtime for host/service" sorter or column...
* 1578 FIX: Folding states of containers with umlauts in titles are now persisted...
* 1580 FIX: Views: Hardcoded single context filters are not shown in filter form anymore...
+ * 1581 FIX: Single context views with missing context show an error message now...
WATO:
* 1170 Added buttons to move rules to top/bottom of the list to ruleset edit dialog
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index 3e6745e..9c057d3 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -939,8 +939,16 @@ def show_view(view, show_heading = False, show_buttons = True,
# have a hardcoded value are not changeable by the user
show_filters = visuals.visible_filters_of_visual(view, use_filters)
+ # Now populate the HTML vars with context vars from the view definition. Hard
+ # coded default values are treated differently:
+ #
+ # a) single context vars of the view are enforced
+ # b) multi context vars can be overwritten by existing HTML vars
visuals.add_context_to_uri_vars(view, datasource["infos"], only_count)
+ # Check that all needed information for configured single contexts are available
+ visuals.verify_single_contexts('views', view)
+
# Af any painter, sorter or filter needs the information about the host's
# inventory, then we load it and attach it as column "host_inventory"
need_inventory_data = False
diff --git a/web/htdocs/visuals.py b/web/htdocs/visuals.py
index 0fd8a81..4dc2342 100644
--- a/web/htdocs/visuals.py
+++ b/web/htdocs/visuals.py
@@ -1117,6 +1117,13 @@ def unpack_context_after_editing(packed_context):
# | |
# '----------------------------------------------------------------------'
+def verify_single_contexts(what, visual):
+ for k, v in get_singlecontext_html_vars(visual):
+ if v == None:
+ raise MKUserError(k, _('This %s can not be displayed, because the '
+ 'necessary context information "%s" is missing.') %
+ (visual_types[what]['title'], k))
+
def visual_title(what, visual):
extra_titles = []