Module: check_mk
Branch: master
Commit: 96e37d8a45c256c3ab08e60a26704600c2989c2c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=96e37d8a45c256…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Mar 15 12:32:14 2019 +0100
Tags of hosts are now available in core and livestatus context
* The previously existing host custom variable TAGS did contain a list
of configured host tags of a host. The problem here is that it is not
clear which tag groups the tags are assigned with. Each consumer of the
tags (e.g. the GUI) had to reverese lookup the tags in the groups. This
only worked because the tags had to be unique accross all tag groups.
* This commit is introducsing a new host / service attribute "tags".
The attribute contains a dictionary of all configured tags of that
object. Each entry in this dictionary is built out of the tag group ID
which is used as key and the choosen tag ID, which is used as value.
* This new attribute is handled in a different way than the TAGS custom
variable. It allows the tag groups and tags to be defined in a less
restrictive way. It is, for example, possible to use non ASCII
characters in the tag groups or tags from the livestatus perspective.
This enables us to adapt a wider range of tags from external systems
like AWS, Azure, Kubernetes and so on. More on this in later commits.
* The new column also allows a lot easier and more flexible filtering
on livestatus protocol layer.
* The quicksearch host tag filter is now using the tag keys and values.
To search all productive hosts use: "tg:criticality:prod" instead of
"tg:prod". It' still compatible to the old syntax, but that may be
dropped as of version 1.7.
* All GUI parts working with tags have been updated to work with the new
"tags" column.
CMK-1814
Change-Id: Ifce1376a9eb31dbd84c57542720f328921625281
---
cmk/gui/plugins/sidebar/quicksearch.py | 27 ++++--
cmk/gui/plugins/views/__init__.py | 3 +-
cmk/gui/plugins/views/painters.py | 44 ++++-----
cmk/gui/plugins/views/sorters.py | 12 ++-
cmk/gui/plugins/views/utils.py | 19 +---
cmk/gui/plugins/visuals/filters.py | 59 +++++-------
cmk/gui/plugins/wato/builtin_attributes.py | 12 ++-
cmk/gui/tags.py | 12 +++
cmk/gui/view_utils.py | 7 ++
cmk/gui/views.py | 45 ++++-----
cmk/gui/wato/pages/folders.py | 12 +--
cmk/gui/wato/pages/hosts.py | 2 +-
cmk/gui/watolib/host_attributes.py | 46 +++++----
cmk/gui/watolib/hosts_and_folders.py | 103 +++++++++------------
cmk_base/automations/check_mk.py | 3 +-
cmk_base/config.py | 7 ++
cmk_base/core_config.py | 13 ++-
cmk_base/core_nagios.py | 13 ++-
cmk_base/data_sources/programs.py | 3 +-
cmk_base/default_config/base.py | 1 +
cmk_base/dump_host.py | 4 +-
cmk_base/modes/__init__.py | 3 +-
tests/integration/livestatus/test_livestatus.py | 28 +++++-
.../unit/cmk/gui/watolib/test_hosts_and_folders.py | 72 ++++++++++++++
tests/unit/cmk_base/test_config.py | 23 +++++
tests/unit/cmk_base/test_core_config.py | 51 +++++++++-
web/htdocs/themes/classic/scss/_pages.scss | 15 ++-
web/htdocs/themes/classic/scss/_wato.scss | 4 -
web/htdocs/themes/facelift/scss/_pages.scss | 46 +++++++++
web/htdocs/themes/facelift/theme.scss | 1 +
30 files changed, 456 insertions(+), 234 deletions(-)
Diff:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=96e37d8a45…