Module: check_mk
Branch: master
Commit: 7598162c34934e34d80798aedb7c30757559f775
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7598162c34934e…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Wed Nov 30 14:13:52 2016 +0100
4107 Now you are able to search for check plugins
---
.werks/4107 | 9 ++++++++
ChangeLog | 1 +
web/htdocs/wato.py | 65 ++++++++++++++++++++++++++++++++++++++++++++++++------
3 files changed, 68 insertions(+), 7 deletions(-)
diff --git a/.werks/4107 b/.werks/4107
new file mode 100644
index 0000000..b2a5514
--- /dev/null
+++ b/.werks/4107
@@ -0,0 +1,9 @@
+Title: Now you are able to search for check plugins
+Level: 1
+Component: multisite
+Compatible: compat
+Version: 1.4.0i3
+Date: 1480511530
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index f80e2b8..cf6575f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -41,6 +41,7 @@
* 4070 Added a painter for the service check period
* 4095 new filter host auxiliary tags
* 4106 new filter host/service-service-level...
+ * 4107 Now you are able to search for check plugins
* 3974 FIX: Sorting comments in hover menu of comments icon by time now
* 4040 FIX: Fix error in view about "No WATO folder ..." in case of host imported via cmcdump...
* 4046 FIX: Repaired html rendering....
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 88b2695..98648c1 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -15009,8 +15009,9 @@ def man_page_catalog_topics():
def mode_check_plugins(phase):
- topic = html.var("topic")
- if topic:
+ search = get_search_expression()
+ topic = html.var("topic")
+ if topic and not search:
path = tuple(topic.split("/")) # e.g. [ "hw", "network" ]
if not re.match("^[a-zA-Z0-9_./]+$", topic):
raise Exception("Invalid topic")
@@ -15024,7 +15025,7 @@ def mode_check_plugins(phase):
titles = man_pages.man_page_catalog_titles()
has_second_level = None
- if topic:
+ if topic and not search:
for t, has_second_level, title, helptext in man_page_catalog_topics():
if t == path[0]:
topic_title = title
@@ -15033,9 +15034,12 @@ def mode_check_plugins(phase):
topic_title = titles.get(path[1], path[1])
if phase == "title":
- heading = _("Catalog of Check Plugins")
- if topic:
- heading += " - " + topic_title
+ if topic and not search:
+ heading = "%s - %s" % ( _("Catalog of Check Plugins"), topic_title )
+ elif search:
+ heading = "%s: %s" % ( _("Check plugins matching"), html.attrencode(search) )
+ else:
+ heading = _("Catalog of Check Plugins")
return heading
elif phase == "buttons":
@@ -15057,12 +15061,19 @@ def mode_check_plugins(phase):
"manually create services in case you cannot or do not want to rely on the "
"automatic service discovery."))
+ search_form( "%s: " % _("Search for check plugins"), "check_plugins" )
+
# The maxium depth of the catalog paths is 3. The top level is being rendered
# like the WATO main menu. The second and third level are being rendered like
# the global settings.
- if topic:
+ if topic and not search:
render_manpage_topic(manpages, titles, has_second_level, path, topic_title)
+
+ elif search:
+ for path, manpages in get_manpages_after_search(manpages, search):
+ render_manpage_list(manpages, titles, path, titles.get(path, path))
+
else:
menu_items = []
for topic, has_second_level, title, helptext in man_page_catalog_topics():
@@ -15071,6 +15082,45 @@ def mode_check_plugins(phase):
render_main_menu(menu_items)
+def get_manpages_after_search(manpages, search):
+ this_search = search
+ collection = {}
+
+ # searches in {"name" : "asd", "title" : "das", ...}
+ def get_matched_entry( entry ):
+ if type(entry) == dict:
+ name = entry.get("name", "")
+ if type(name) == str:
+ name = name.decode("utf8")
+ title = entry.get("title", "")
+ if type(title) == str:
+ title = title.decode("utf8")
+ if this_search in name.lower() or this_search in title.lower():
+ return entry
+ return None
+
+ def check_entries( key, entries ):
+ if type(entries) == list:
+ these_matches = []
+ for entry in entries:
+ match = get_matched_entry(entry)
+ if match:
+ these_matches.append(match)
+
+ if these_matches:
+ collection.setdefault( key, [] )
+ collection[key] += these_matches
+
+ elif type(entries) == dict:
+ for key, subentries in entries.items():
+ check_entries( key, subentries )
+
+ for key, entries in manpages.items():
+ check_entries( key, entries )
+
+ return collection.items()
+
+
def get_check_catalog(args):
def path_prefix_matches(p, op):
if op and not p:
@@ -15129,6 +15179,7 @@ def render_manpage_topic(manpages, titles, has_second_level, path, topic_title):
for title, subnode, path_comp in entries:
render_manpage_list(subnode, titles, path_comp, title)
+
def get_check_plugin_stats(subnode):
if type(subnode) == list:
num_cats = 1
Module: check_mk
Branch: master
Commit: a2920793062f131bd52fe9f6292c2c1d3de8ca20
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a2920793062f13…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Nov 30 11:35:44 2016 +0100
pytest: Run in verbose mode by default
---
pytest.ini | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pytest.ini b/pytest.ini
index d0924d8..a43d447 100644
--- a/pytest.ini
+++ b/pytest.ini
@@ -3,4 +3,4 @@ testpaths = tests
# Fail on first error and enable stepwise plugin to track steps and
# be able to continue with the failed test after analyzing and fixing
# the issue
-addopts = -rs --maxfail=1
+addopts = -rs -v --maxfail=1
Module: check_mk
Branch: master
Commit: b6c1ba80bb0943dce14af9d1393eb15085629082
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b6c1ba80bb0943…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Tue Nov 29 14:58:16 2016 +0100
4097 FIX Event console: Make writing of status file more robust
Previously, a system crash at an inopportune moment could cause
the status file to be corrupt, requiring manual deletion to start
the mkeventd.
---
.werks/4097 | 12 ++++++++++++
ChangeLog | 3 +++
bin/mkeventd | 7 ++++++-
3 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/.werks/4097 b/.werks/4097
new file mode 100644
index 0000000..c83bc0d
--- /dev/null
+++ b/.werks/4097
@@ -0,0 +1,12 @@
+Title: Event console: Make writing of status file more robust
+Level: 1
+Component: ec
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.4.0i3
+Date: 1480427713
+
+Previously, a system crash at an inopportune moment could cause
+the status file to be corrupt, requiring manual deletion to start
+the mkeventd.
diff --git a/ChangeLog b/ChangeLog
index 8bd2313..f80e2b8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -72,6 +72,9 @@
BI:
* 3991 FIX: BI Aggregations: no longer show duplicate aggregations when an aggregation has mulitple groups
+ Event Console:
+ * 4097 FIX: Event console: Make writing of status file more robust...
+
Livestatus:
* 3651 FIX: Fixed potential segfault with Nagios core when accessing log/commands table via Livestatus....
diff --git a/bin/mkeventd b/bin/mkeventd
index d6e8c67..5fb2cfa 100755
--- a/bin/mkeventd
+++ b/bin/mkeventd
@@ -3458,7 +3458,12 @@ class EventStatus():
status = self.pack_status()
path = g_state_dir + "/status"
# Belive it or not: cPickle is more than two times slower than repr()
- file(path + ".new", "w").write(repr(status) + "\n")
+ f=file(path + ".new", "w")
+ f.write(repr(status) + "\n")
+ fd = f.fileno()
+ f.flush()
+ f.close()
+ os.fsync(fd)
os.rename(path + ".new", path)
elapsed = time.time() - now
if opt_debug:
Module: check_mk
Branch: master
Commit: 49bbfaf4ad96d9a784ed336c432d29e913c4361e
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=49bbfaf4ad96d9…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue Nov 29 13:03:32 2016 +0100
3995 skype check: updated perfvariable and metric names, making their purpose more clear
Due to the renaming, already existing performance data is lost.
This check was introduced recently, so this won't have much impact.
---
.werks/3995 | 10 +++
ChangeLog | 2 +
checks/skype | 72 ++++++++++----------
web/plugins/metrics/check_mk.py | 142 ++++++++++++++++++++--------------------
4 files changed, 119 insertions(+), 107 deletions(-)
Diff: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=49bbfaf4ad…