Module: check_mk
Branch: master
Commit: 2a328ebdce3d153974fa7641df929989f7e48eb8
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2a328ebdce3d15…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Oct 10 14:12:46 2016 +0200
Improved general regex help texts a bit; removed special help text from rule editor
---
web/htdocs/valuespec.py | 23 +++++++++++++++++++----
web/htdocs/wato.py | 7 -------
2 files changed, 19 insertions(+), 11 deletions(-)
diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py
index d6e3f0d..c451805 100644
--- a/web/htdocs/valuespec.py
+++ b/web/htdocs/valuespec.py
@@ -542,17 +542,28 @@ class RegExp(TextAscii):
help_text.append(_("The text entered here is handled as a regular expression pattern."))
if self._mode == RegExp.infix:
- help_text.append(_("The pattern is applied as infix search."))
+ help_text.append(_("The pattern is applied as infix search. Add a leading <tt>^</tt> "
+ "to make it match from the beginning and/or a tailing <tt>$</tt> "
+ "to match till the end of the text."))
elif self._mode == RegExp.prefix:
- help_text.append(_("The pattern is matched from the beginning."))
+ help_text.append(_("The pattern is matched from the beginning. Add a tailing "
+ "<tt>$</tt> to change it to a whole text match."))
elif self._mode == RegExp.complete:
- help_text.append(_("The pattern is matching the whole text."))
+ help_text.append(_("The pattern is matching the whole text. You can add <tt>.*</tt> "
+ "in front or at the end of your pattern to make it either a prefix "
+ "or infix search."))
if self._case_sensitive == True:
help_text.append(_("The match is performed case sensitive."))
elif self._case_sensitive == False:
help_text.append(_("The match is performed case insensitive."))
+ help_text.append(
+ _("Please note that any backslashes need to be escaped using a backslash, "
+ "for example you need to insert <tt>C:\\\\windows\\\\</tt> if you want to match "
+ "<tt>c:\windows\</tt>.")
+ )
+
return " ".join(help_text)
@@ -1050,8 +1061,10 @@ class ListOfStrings(ValueSpec):
help_text = ValueSpec.help(self)
field_help = self._valuespec.help()
- if field_help:
+ if help_text and field_help:
return help_text + " " + field_help
+ elif field_help:
+ return field_help
else:
return help_text
@@ -1074,6 +1087,8 @@ class ListOfStrings(ValueSpec):
self._valuespec.render_input(vp + "_%d" % nr, s)
html.write('</div>')
html.write('</div>')
+ html.write("<div style=\"clear:left\"></div>")
+ html.help(self.help())
html.javascript("list_of_strings_init('%s');" % vp);
def canonical_value(self):
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index a85bf7b..0334d7e 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -13314,17 +13314,10 @@ def mode_edit_rule(phase, new = False):
itemspec.render_input("item", value)
else:
vs_rule_service_conditions().render_input("itemlist", cleaned_item_list)
- html.write("<br><br>")
html.checkbox("negate_entries", negate_entries, label =
_("<b>Negate:</b> make rule apply for <b>all but</b> the above entries"))
- if not itemenum:
- html.help(_("The entries here are regular expressions to match the beginning. "
- "Add a <tt>$</tt> for an exact match. An arbitrary substring is matched "
- "with <tt>.*</tt><br>Please note that on windows systems any backslashes need to be escaped."
- "For example C:\\\\tmp\\\\message.log"))
-
html.write("</div>")
forms.end()
Module: check_mk
Branch: master
Commit: 66c42e6e575d0bd7b341a74adda812c0e2683587
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=66c42e6e575d0b…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Oct 10 13:26:45 2016 +0200
tests: Now stop/start site when enabling livestatus via tcp when site was already running
---
tests/testlib/__init__.py | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/tests/testlib/__init__.py b/tests/testlib/__init__.py
index 16b2eff..4179054 100644
--- a/tests/testlib/__init__.py
+++ b/tests/testlib/__init__.py
@@ -276,14 +276,18 @@ class Site(object):
# This opens a currently free TCP port and remembers it in the object for later use
# Not free of races, but should be sufficient.
def open_livestatus_tcp(self):
+ start_again = False
+
if self.is_running():
- assert self.get_config("LIVESTATUS_TCP") == "on", \
- "Livestatus-TCP disabled (Site is running, so could not enable it)"
- return
+ start_again = True
+ self.stop()
self.set_config("LIVESTATUS_TCP", "on")
self.set_config("LIVESTATUS_TCP_PORT", str(self._livestatus_port))
+ if start_again:
+ self.start()
+
def _gather_livestatus_port(self):
if self.reuse and self.exists():
Module: check_mk
Branch: master
Commit: e0700ee05f3d0ece1f344c841347a55aa2e925a5
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e0700ee05f3d0e…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Oct 10 09:42:11 2016 +0200
Fixed syntax error in man page
---
checkman/cups_queues | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/checkman/cups_queues b/checkman/cups_queues
index 1f92e2d..abae460 100644
--- a/checkman/cups_queues
+++ b/checkman/cups_queues
@@ -28,10 +28,10 @@ inventory:
Checks are created for all available printers in {lpstat -p} output.
[parameters]
- job_count (int, int): WARN/CRIT if number of jobs are above
- job_age (int, int): WARN/CRIT if oldest job is above in seconds
- is_idle (int): Internal state for pritner state "is idle"
+job_count (int, int): WARN/CRIT if number of jobs are above
+job_age (int, int): WARN/CRIT if oldest job is above in seconds
+is_idle (int): Internal state for pritner state "is idle"
[configuration]
- cups_queues_default_levels (int, int, int, int): The global default levels for
+cups_queues_default_levels (int, int, int, int): The global default levels for
all checks of this type. This is {(5, 10, 360, 720)}.
Module: check_mk
Branch: master
Commit: a31a0d9796ac65816f98052290e18528174a9900
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a31a0d9796ac65…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Sat Oct 8 14:13:42 2016 +0200
Cleaned up subprocess calls
Calls to subprocess.Popen() must be treated carefully:
a) Try to avoid shell=True. In case a shell is invoked and someone
is able to add user input, for example in case a validation of
user input is not sufficient, the user is able to inject commands.
b) Removing shell=True also saves performance (not spawning a shell)
c) Use close_fds=True to prevent file descriptor leaks or accidentially
closed file descriptors.
Same applies to os.popen() and os.system() calls which have not been
checked nor cleaned up yet.
---
bin/mkbackup | 4 +-
bin/mkeventd | 21 +++++------
modules/automation.py | 7 +++-
modules/check_mk.py | 87 +++++++++++++++++++++++++------------------
modules/notify.py | 14 ++++---
modules/snmp.py | 10 +++--
web/htdocs/backup.py | 2 +-
web/htdocs/crash_reporting.py | 4 +-
web/htdocs/multitar.py | 3 +-
web/htdocs/notify.py | 2 +-
web/htdocs/wato.py | 17 +++++----
11 files changed, 100 insertions(+), 71 deletions(-)
Diff: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=a31a0d9796…