Module: check_mk
Branch: master
Commit: 1dd47500198b576b5271e0b2141bc481913f302e
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1dd47500198b57…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue Jun 10 12:07:45 2014 +0200
CPU utilization: increased maximum value to 10000
---
.werks/935 | 11 +++++++++++
ChangeLog | 1 +
web/plugins/wato/check_parameters.py | 8 ++++----
3 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/.werks/935 b/.werks/935
new file mode 100644
index 0000000..a816503
--- /dev/null
+++ b/.werks/935
@@ -0,0 +1,11 @@
+Title: CPU utilization: increased maximum value to 10000
+Level: 1
+Component: wato
+Version: 1.2.5i4
+Date: 1402394358
+Class: fix
+
+The maximum value for the CPU utilization in the WATO rules "State and count of processes"
+and "Process inventory" was set to 101 percent. There were some instances where this value was higher than this limit.
+For example if an application used multiple CPUs or the utilization value was calculated for a group of processes.
+
diff --git a/ChangeLog b/ChangeLog
index ab84049..45919e8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -17,6 +17,7 @@
WATO:
* 0987 New button for updating DNS cache...
* 0813 FIX: LDAP: Improved slightly missleading logging of LDAP sync actions...
+ * 0935 FIX: CPU utilization: increased maximum value to 10000...
Reporting & Availability:
* 0985 Availability: display phases of freqent state changes as "chaos"...
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index cef70c8..1a49d28 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -378,8 +378,8 @@ register_rule(group + '/' + subgroup_inventory,
Tuple(
title = _("Levels on CPU utilization"),
elements = [
- Percentage(title = _("Warning if above"), default_value = 90),
- Percentage(title = _("Critical if above"), default_value = 98),
+ Percentage(title = _("Warning if above"), default_value = 90, maxvalue = 10000),
+ Percentage(title = _("Critical if above"), default_value = 98, maxvalue = 10000),
],
)),
( "cpu_average",
@@ -5000,8 +5000,8 @@ register_check_parameters(
Tuple(
title = _("Levels on CPU utilization"),
elements = [
- Percentage(title = _("Warning if above"), default_value = 90),
- Percentage(title = _("Critical if above"), default_value = 98),
+ Percentage(title = _("Warning if above"), default_value = 90, maxvalue = 10000),
+ Percentage(title = _("Critical if above"), default_value = 98, maxvalue = 10000),
],
)),
( "cpu_average",
Module: check_mk
Branch: master
Commit: e918b8e8b51b3199fe15a7e3beae04193b5ef105
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e918b8e8b51b31…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Tue Jun 10 10:23:36 2014 +0200
FIX mobile gui: Fixed colors of command list
The link color is now black instead of white. This is much more readable.
---
.werks/166 | 9 +++++++++
ChangeLog | 1 +
web/htdocs/mobile.css | 4 +++-
3 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/.werks/166 b/.werks/166
new file mode 100644
index 0000000..a26a93e
--- /dev/null
+++ b/.werks/166
@@ -0,0 +1,9 @@
+Title: mobile gui: Fixed colors of command list
+Level: 1
+Component: multisite
+Class: fix
+State: unknown
+Version: 1.2.5i4
+Date: 1402388501
+
+The link color is now black instead of white. This is much more readable.
diff --git a/ChangeLog b/ChangeLog
index 3568bdf..7c11804 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,7 @@
Multisite:
* 0934 FIX: Logwatch messages with class unknown ( 'u' ) now displayed as WARN...
+ * 0166 FIX: mobile gui: Fixed colors of command list...
WATO:
* 0987 New button for updating DNS cache...
diff --git a/web/htdocs/mobile.css b/web/htdocs/mobile.css
index 14d6df6..2979b42 100644
--- a/web/htdocs/mobile.css
+++ b/web/htdocs/mobile.css
@@ -56,7 +56,9 @@ body.mobile div.error {
background-color: #fcc;
}
-
+body.mobile div.command_group a {
+ color: black;
+}
body.mobile table.data {
/* width: 10px;*/ /* 100%; */
Module: check_mk
Branch: master
Commit: 8968c8085e214a6e689e16e33d94914bc53c4421
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8968c8085e214a…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Jun 6 13:29:55 2014 +0200
States of events can now be set by patterns
The states of events created by a rule can now be set by regex patterns. A rule can now
create events with different states. The mechanism is as follows:
1. The "text to match" patterns needs to match a message
2. When a rule has configured "(set by message text)" as state, and patterns are defined
for the single states, the message will be matches agains these patterns to calculate
the state of the event.
3. When none of these patterns matches, the event is set to UNKNOWN
---
.werks/816 | 15 ++++++++++
ChangeLog | 3 ++
mkeventd/bin/mkeventd | 53 ++++++++++++++++++++++++++-------
mkeventd/web/plugins/wato/mkeventd.py | 52 ++++++++++++++++++++++++++++----
4 files changed, 107 insertions(+), 16 deletions(-)
diff --git a/.werks/816 b/.werks/816
new file mode 100644
index 0000000..fa6c985
--- /dev/null
+++ b/.werks/816
@@ -0,0 +1,15 @@
+Title: States of events can now be set by patterns
+Level: 2
+Component: ec
+Version: 1.2.5i4
+Date: 1402053935
+Class: feature
+
+The states of events created by a rule can now be set by regex patterns. A rule can now
+create events with different states. The mechanism is as follows:
+
+1. The "text to match" patterns needs to match a message
+2. When a rule has configured "(set by message text)" as state, and patterns are defined
+for the single states, the message will be matches agains these patterns to calculate
+the state of the event.
+3. When none of these patterns matches, the event is set to UNKNOWN
diff --git a/ChangeLog b/ChangeLog
index dca2aa4..2db0181 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -19,6 +19,9 @@
Reporting & Availability:
* 0985 Availability: display phases of freqent state changes as "chaos"...
+ Event Console:
+ * 0816 States of events can now be set by patterns...
+
1.2.5i3:
Core & Setup:
diff --git a/mkeventd/bin/mkeventd b/mkeventd/bin/mkeventd
index e61528e..e9a9eb0 100755
--- a/mkeventd/bin/mkeventd
+++ b/mkeventd/bin/mkeventd
@@ -1369,6 +1369,22 @@ class EventServer:
count_rules = 0
count_unspecific = 0
+ def compile_matching_value(key, val):
+ value = val.strip()
+ # Remove leading .* from regex. This is redundant and
+ # dramatically destroys performance when doing an infix search.
+ if key in [ "match", "match_ok" ]:
+ while value.startswith(".*") and not value.startswith(".*?"):
+ value = value[2:]
+
+ if not value:
+ return None
+
+ if is_regex(value):
+ return re.compile(value, re.IGNORECASE)
+ else:
+ return val.lower()
+
for rule in rules:
if rule.get("disabled"):
count_disabled += 1
@@ -1387,19 +1403,22 @@ class EventServer:
try:
for key in [ "match", "match_ok", "match_host", "match_application" ]:
if key in rule:
- value = rule[key].strip()
- # Remote leading .* from regex. This is redundant and
- # dramatically destroys performance when doing an infix search.
- if key in [ "match", "match_ok" ]:
- while value.startswith(".*") and not value.startswith(".*?"):
- value = value[2:]
- if not value:
+ value = compile_matching_value(key, rule[key])
+ if value == None:
del rule[key]
continue
- if is_regex(value):
- rule[key] = re.compile(value, re.IGNORECASE)
- else:
- rule[key] = rule[key].lower()
+
+ rule[key] = value
+
+ if 'state' in rule and type(rule['state']) == tuple and rule['state'][0] == 'text_pattern':
+ for key in [ '2', '1', '0' ]:
+ if key in rule['state'][1]:
+ value = compile_matching_value('state', rule['state'][1][key])
+ if value == None:
+ del rule['state'][1][key]
+ else:
+ rule['state'][1][key] = value
+
except Exception, e:
if opt_debug:
raise
@@ -1681,8 +1700,20 @@ class EventServer:
event["state"] = 2
else:
event["state"] = 1
+ elif type(rule["state"]) == tuple and rule["state"][0] == "text_pattern":
+ for key in [ '2', '1', '0', '3' ]:
+ if key in rule["state"][1]:
+ log(repr(rule["state"][1][key]))
+ match_groups = match(rule["state"][1][key], event["text"], complete = False)
+ if match_groups != False:
+ event["state"] = int(key)
+ break
+ elif key == '3': # No rule matched!
+ event["state"] = 3
+
else:
event["state"] = rule["state"]
+
if "sl" not in event:
event["sl"] = rule["sl"]
event["first"] = event["time"]
diff --git a/mkeventd/web/plugins/wato/mkeventd.py b/mkeventd/web/plugins/wato/mkeventd.py
index ad724a0..48c6d81 100644
--- a/mkeventd/web/plugins/wato/mkeventd.py
+++ b/mkeventd/web/plugins/wato/mkeventd.py
@@ -202,10 +202,45 @@ vs_mkeventd_actions = \
)
-class RuleState(MonitoringState):
+class RuleState(CascadingDropdown):
def __init__(self, **kwargs):
- MonitoringState.__init__(self, **kwargs)
- self._choices.append((-1, _("(set by syslog)")))
+ choices = [
+ ( 0, _("OK")),
+ ( 1, _("WARN")),
+ ( 2, _("CRIT")),
+ ( 3, _("UNKNOWN")),
+ (-1, _("(set by syslog)")),
+ ('text_pattern', _('(set by message text)'),
+ Dictionary(
+ elements = [
+ ('2', RegExpUnicode(
+ title = _("CRIT Pattern"),
+ help = _("When the given regular expression (infix search) matches "
+ "the events state is set to CRITICAL."),
+ size = 64,
+ )),
+ ('1', RegExpUnicode(
+ title = _("WARN Pattern"),
+ help = _("When the given regular expression (infix search) matches "
+ "the events state is set to WARNING."),
+ size = 64,
+ )),
+ ('0', RegExpUnicode(
+ title = _("OK Pattern"),
+ help = _("When the given regular expression (infix search) matches "
+ "the events state is set to OK."),
+ size = 64,
+ )),
+ ],
+ help = _('Individual patterns matching the text (which must have been matched by '
+ 'the generic "text to match pattern" before) which set the state of the '
+ 'generated event depending on the match.<br><br>'
+ 'First the CRITICAL pattern is tested, then WARNING and OK at last. '
+ 'When none of the patterns matches, the events state is set to UNKNOWN.'),
+ )
+ ),
+ ]
+ CascadingDropdown.__init__(self, choices = choices, **kwargs)
vs_mkeventd_rule = Dictionary(
title = _("Rule Properties"),
@@ -966,8 +1001,15 @@ def mode_mkeventd_rules(phase):
if rule.get("drop"):
table.cell(_("Priority"), _("DROP"), css="state statep")
else:
- txt = {0:_("OK"), 1:_("WARN"), 2:_("CRIT"), 3:_("UNKNOWN"), -1:_("(syslog)")}[rule["state"]]
- table.cell(_("Priority"), txt, css="state state%d" % rule["state"])
+ if type(rule['state']) == tuple:
+ stateval = rule["state"][0]
+ else:
+ stateval = rule["state"]
+ txt = { 0: _("OK"), 1:_("WARN"),
+ 2: _("CRIT"), 3:_("UNKNOWN"),
+ -1: _("(syslog)"),
+ 'text_pattern':_("(set by message text)") }[stateval]
+ table.cell(_("Priority"), txt, css="state state%s" % stateval)
# Syslog priority
if "match_priority" in rule: