Module: check_mk
Branch: master
Commit: e8bb7c633edbfda168d542dd1a9281ac87e29aec
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e8bb7c633edbfd…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Jan 12 13:13:14 2015 +0100
made forwarded hostname configurable for new check check_mail
---
checks/check_mail | 3 +++
doc/treasures/active_checks/check_mail | 2 +-
web/plugins/wato/active_checks.py | 14 ++++++++------
3 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/checks/check_mail b/checks/check_mail
index 509c87c..386b416 100644
--- a/checks/check_mail
+++ b/checks/check_mail
@@ -59,6 +59,9 @@ def check_mail_arguments(params):
if 'facility' in forward:
args += ' --forward-facility=%d' % forward['facility']
+ if 'host' in forward:
+ args += ' --forward-host=%s' %
quote_shell_string(forward['host'])
+
if forward.get('application'):
args += ' --forward-app=%s' %
quote_shell_string(forward['application'])
diff --git a/doc/treasures/active_checks/check_mail
b/doc/treasures/active_checks/check_mail
index bc77935..7c2ccf6 100755
--- a/doc/treasures/active_checks/check_mail
+++ b/doc/treasures/active_checks/check_mail
@@ -318,7 +318,7 @@ def forward_to_ec(mails):
# Construct the final syslog message
log = '<%d>%s' % (forward_facility + priority, cur_time)
- log += ' %s %s: %s' % (forward_host or 'None', application,
log_line)
+ log += ' %s %s: %s' % (forward_host or fetch_server, application,
log_line)
messages.append(log)
g_forwarded.append(index)
diff --git a/web/plugins/wato/active_checks.py b/web/plugins/wato/active_checks.py
index 050047b..b7ccfc2 100644
--- a/web/plugins/wato/active_checks.py
+++ b/web/plugins/wato/active_checks.py
@@ -1876,16 +1876,14 @@ register_rule(group,
'but only the whones whose subject matches the given
regular expression. '),
)),
('facility', DropdownChoice(
- title = _("Syslog facility for forwarded messages"),
- help = _("When forwarding messages and no facility can be
extracted from the "
- "message this facility is used."),
+ title = _("Events: Syslog facility"),
+ help = _("Use this syslog facility for all created
events"),
choices = syslog_facilities,
default_value = 2, # mail
)),
('application', Alternative(
- title = _("Syslog application"),
- help = _("When forwarding messages and no facility can be
extracted from the "
- "message this application is used."),
+ title = _("Events: Syslog application"),
+ help = _("Use this syslog application for all created
events"),
elements = [
FixedValue(None,
title = _("Use the mail subject"),
@@ -1900,6 +1898,10 @@ register_rule(group,
),
]
)),
+ ('host', TextAscii(
+ title = _('Events: Hostname'),
+ help = _('Use this hostname for all created events instead of
the name of the mailserver'),
+ )),
('body_limit', Integer(
title = _('Limit length of mail body'),
help = _('When forwarding mails from the mailbox to the event
console, the '