Fixed pattern loading in logwatch check
User-Agent: Heirloom mailx 12.4 7/29/08
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Module: check_mk
Branch: master
Commit: 49da647c4af7eea5044e720319a28d43bc910921
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=49da647c4af7ee…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Apr 13 11:02:16 2012 +0200
Fixed broken link to pattern editor; Fixed pattern loading in logwatch check
---
checks/logwatch | 4 ++--
web/htdocs/wato.py | 6 +++---
web/plugins/wato/check_parameters.py | 7 ++++---
3 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/checks/logwatch b/checks/logwatch
index fabd134..81a8d48 100644
--- a/checks/logwatch
+++ b/checks/logwatch
@@ -95,8 +95,7 @@ def logwatch_level_worst(worst, level):
# Constructs simple list of pairs: [ ('W', 'crash.exe'), ('C',
'sshd.*test') ]
def logwatch_precompile(hostname, item, params):
# First load the logwatch_rules var (used by WATO)
- description = check_info['logwatch']['service_description'] % item
- rules = service_extra_conf(hostname, description, logwatch_rules)
+ rules = get_checkgroup_parameters(hostname, 'logwatch', item)
# Initialize params with these rules but remove the comment
params = []
@@ -340,6 +339,7 @@ check_info['logwatch'] = {
'service_description': "LOG %s",
'has_perfdata': 0,
'inventory_function': inventory_logwatch,
+ 'group': 'logwatch',
}
precompile_params['logwatch'] = logwatch_precompile
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 3833af5..9d9a229 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -9936,7 +9936,7 @@ def mode_pattern_editor(phase):
html.context_button(_('Edit Logfile Rules'), make_link([
('mode', 'edit_ruleset'),
- ('varname', 'checkgroup_parameters:logwatch_rules')
+ ('varname', 'checkgroup_parameters:logwatch')
]),
'edit'
)
@@ -9989,7 +9989,7 @@ def mode_pattern_editor(phase):
html.show_user_errors()
return
- varname = 'checkgroup_parameters:logwatch_rules'
+ varname = 'checkgroup_parameters:logwatch'
rulespec = g_rulespecs[varname]
all_rulesets = load_all_rulesets()
ruleset = all_rulesets.get(varname)
@@ -10001,7 +10001,7 @@ def mode_pattern_editor(phase):
+ _('There are no logfile patterns defined. You may create '
'logfile patterns using the <a href="%s">Rule
Editor</a>.') % make_link([
('mode', 'edit_ruleset'),
- ('varname', 'checkgroup_parameters:logwatch_rules')
+ ('varname', 'checkgroup_parameters:logwatch')
])
+ "</div>"
)
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 4950f13..dc738b1 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -113,7 +113,7 @@ checkgroups.append((
checkgroups.append((
subgroup_applications,
- "logwatch_rules",
+ "logwatch",
_("Logfile patterns"),
ListOf(
Tuple(
@@ -141,8 +141,9 @@ checkgroups.append((
help = _('You can define one or several patterns (regular expressions) in each
logfile pattern rule. '
'These patterns are applied to the selected logfiles to reclassify the
'
'matching log messages. The first pattern which matches a line will
'
- 'be used for reclassifying a message. You can use the <a
href="%s">Logfile Pattern Analyzer</a> '
- 'to test the rules you defined here.') %
html.makeuri([('mode', 'pattern_editor')]),
+ 'be used for reclassifying a message. You can use the '
+ '<a href="wato.py?mode=pattern_editor">Logfile Pattern
Analyzer</a> '
+ 'to test the rules you defined here.'),
add_label = _("Add pattern"),
),
TextAscii(