Module: check_mk
Branch: master
Commit: c326c0045223077580750ee8e1ee1c73a2e67058
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c326c004522307…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Mon Nov 27 09:37:49 2017 +0100
Add checks marker to pytest.ini
Change-Id: I679eb127319c4ccfdbfa90467dbf43a08cccbb6a
---
pytest.ini | 1 +
1 file changed, 1 insertion(+)
diff --git a/pytest.ini b/pytest.ini
index 253a1d9..6b22cbd 100644
--- a/pytest.ini
+++ b/pytest.ini
@@ -10,5 +10,6 @@ markers =
packaging: This is a test to execute to verify the packaging of the testbuilds.
gui_crawl: All linked pages of the Web interface are visited and searched for errors
html_gentest: Generate test cases for htmllib refactoring.
+ checks: Run all existing test cases for checks.
filterwarnings =
ignore::ImportWarning
Module: check_mk
Branch: master
Commit: 2d80f11834ae417f39373b89e24d8f2f278883ae
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2d80f11834ae41…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Mon Nov 27 09:06:10 2017 +0100
Clarify comment
Change-Id: If4c1489ffbc504835cad1754769ebf3a363896e0
---
tests/checks/test_df.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/checks/test_df.py b/tests/checks/test_df.py
index accc630..3ff24cc 100644
--- a/tests/checks/test_df.py
+++ b/tests/checks/test_df.py
@@ -31,7 +31,7 @@ def test_df_discovery_with_parse(check_manager, monkeypatch, info, result, inclu
import cmk_base.checks
import cmk_base
-# NOTE: This is the result of trying to mock the the ruleset variable itself instead of the
+# NOTE: This commented-out code is the result of trying to mock the the ruleset variable itself instead of the
# host_extra_conf_merged function. It did not work. Maybe we can get it to work at a later stage.
# import cmk_base.rulesets
# monkeypatch.setitem(cmk_base.checks._check_contexts["df"], "inventory_df_rules",
Module: check_mk
Branch: master
Commit: d63fca1f8a5552a61fa0c5463c9eb92b7f5467d7
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d63fca1f8a5552…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Nov 27 09:27:07 2017 +0100
5542 Table quick search: Is now using regex matching instead of substring search
The quick search feature of tables is now treating the given search term as regular
expression. A case insensitive infix search is being performed with the given string.
Change-Id: Ibc903e3d71f45670233ac80c2bcb930042d1554d
---
.werks/5542 | 11 +++++++++++
web/htdocs/table.py | 8 +++++---
2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/.werks/5542 b/.werks/5542
new file mode 100644
index 0000000..e9685af
--- /dev/null
+++ b/.werks/5542
@@ -0,0 +1,11 @@
+Title: Table quick search: Is now using regex matching instead of substring search
+Level: 1
+Component: wato
+Compatible: compat
+Edition: cre
+Version: 1.5.0i2
+Date: 1511771143
+Class: feature
+
+The quick search feature of tables is now treating the given search term as regular
+expression. A case insensitive infix search is being performed with the given string.
diff --git a/web/htdocs/table.py b/web/htdocs/table.py
index 8e72274..c4139a0 100644
--- a/web/htdocs/table.py
+++ b/web/htdocs/table.py
@@ -24,9 +24,9 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
-# external imports
+import re
from contextlib import contextmanager
-# internal imports
+
import config
from lib import num_split
@@ -483,13 +483,15 @@ class Table(object):
def _filter_rows(rows, search_term):
filtered_rows = []
+ match_regex = re.compile(search_term, re.IGNORECASE)
+
for row, css, state, fixed, attrs in rows:
if state == "header" or fixed:
filtered_rows.append((row, css, state, fixed, attrs))
continue # skip filtering of headers or fixed rows
for cell_content, css_classes, colspan in row:
- if search_term in cell_content.lower():
+ if match_regex.search(cell_content):
filtered_rows.append((row, css, state, fixed, attrs))
break # skip other cells when matched
return filtered_rows
Module: check_mk
Branch: master
Commit: 709d537dbdce1ec78d8cd38a6ed421f06574a6e4
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=709d537dbdce1e…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Nov 24 16:15:46 2017 +0100
Fixed configuring ping-only hosts after recent agent type recode; Moved builtin aux tags to correct topics
Change-Id: I5d6d4072c983400491f54f2c22fa39747ba6414b
---
web/htdocs/watolib.py | 27 ++++++++++++++-------------
1 file changed, 14 insertions(+), 13 deletions(-)
diff --git a/web/htdocs/watolib.py b/web/htdocs/watolib.py
index 9aebf8f..4f9dcb5 100644
--- a/web/htdocs/watolib.py
+++ b/web/htdocs/watolib.py
@@ -1342,34 +1342,29 @@ class CREFolder(BaseFolder):
if "tag_agent" not in attributes:
return attributes # Nothing set here, no transformation necessary
- if "tag_snmp" in attributes or "tag_ping" in attributes:
+ if "tag_snmp" in attributes:
return attributes # Already in new format, no transformation necessary
value = attributes["tag_agent"]
if value == "cmk-agent":
attributes["tag_snmp"] = "no-snmp"
- attributes["tag_ping"] = None
elif value == "snmp-only":
attributes["tag_agent"] = "no-agent"
attributes["tag_snmp"] = "snmp-v2"
- attributes["tag_ping"] = None
elif value == "snmp-v1":
attributes["tag_agent"] = "no-agent"
attributes["tag_snmp"] = "snmp-v1"
- attributes["tag_ping"] = None
elif value == "snmp-tcp":
attributes["tag_agent"] = "cmk-agent"
attributes["tag_snmp"] = "snmp-v2"
- attributes["tag_ping"] = None
elif value == "ping":
attributes["tag_agent"] = "no-agent"
attributes["tag_snmp"] = "no-snmp"
- attributes["tag_ping"] = "ping"
return attributes
@@ -2752,6 +2747,14 @@ class CREHost(WithPermissionsAndAttributes):
for attr, topic in all_host_attributes():
value = effective.get(attr.name())
tags.update(attr.get_tag_list(value))
+
+ # When a host as been configured not to use the agent and not to use
+ # SNMP, it needs to get the ping tag assigned.
+ # Because we need information from multiple attributes to get this
+ # information, we need to add this decision here.
+ if "no-snmp" in tags and "no-agent" in tags:
+ tags.add("ping")
+
return tags
@@ -6062,9 +6065,6 @@ def register_builtin_host_tags():
del builtin_host_tags[:]
builtin_host_tags += [
- ("ping", "%s/%s" % (_("Data sources"), _("Ping only")), [
- ("ping", _("only ping this device"), []),
- ]),
("agent", "%s/%s" % (_("Data sources"), _("Check_MK Agent")), [
("cmk-agent", _("Contact either Check_MK Agent or use datasource program"), ["tcp"]),
("all-agents", _("Contact Check_MK agent and all enabled datasource programs"), ["tcp"]),
@@ -6090,10 +6090,11 @@ def register_builtin_host_tags():
del builtin_aux_tags[:]
builtin_aux_tags += [
- ("ip-v4", _("IPv4")),
- ("ip-v6", _("IPv6")),
- ("snmp", _("Monitor via SNMP")),
- ("tcp", _("Monitor via Check_MK Agent")),
+ ("ip-v4", "%s/%s" % (_("Address"), _("IPv4"))),
+ ("ip-v6", "%s/%s" % (_("Address"), _("IPv6"))),
+ ("snmp", "%s/%s" % (_("Data sources"), _("Monitor via SNMP"))),
+ ("tcp", "%s/%s" % (_("Data sources"), _("Monitor via Check_MK Agent"))),
+ ("ping", "%s/%s" % (_("Data sources"), _("Only ping this device"))),
]
Module: check_mk
Branch: master
Commit: 4cd0aad7912ad040ef7b3492457b9fe94a8c43f9
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4cd0aad7912ad0…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Nov 24 16:10:10 2017 +0100
Show "created host, ... go to discovery" message only for non ping hosts
Change-Id: I0107ec4941ac88189860d4de1555a61743689aba
---
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 d538655..f559d55 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -1473,7 +1473,7 @@ def action_edit_host(mode, hostname, is_cluster):
if mode != "edit": # new/clone
- if host.tag('agent') != 'ping':
+ if "ping" not in host.tags():
create_msg = _('Successfully created the host. Now you should do a '
'<a href="%s">service discovery</a> in order to auto-configure '
'all services to be checked on this host.') % \