Module: check_mk
Branch: master
Commit: 13f5e2fa6fa7d8d8797bd4fe57c86453c52d7ee1
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=13f5e2fa6fa7d8…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Thu Oct 22 16:41:37 2015 +0200
#2703 logwatch.ec: now transfers the service level to the event console
if a service level is configured for a logwatch->ec forwarding service, that service
level will now
appear in the event console.
---
.werks/2703 | 10 ++++++++++
ChangeLog | 1 +
checks/logwatch | 6 +++++-
3 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/.werks/2703 b/.werks/2703
new file mode 100644
index 0000000..359ff96
--- /dev/null
+++ b/.werks/2703
@@ -0,0 +1,10 @@
+Title: logwatch.ec: now transfers the service level to the event console
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i4
+Date: 1445524766
+Class: feature
+
+if a service level is configured for a logwatch->ec forwarding service, that service
level will now
+appear in the event console.
diff --git a/ChangeLog b/ChangeLog
index f135ad1..c3a9ad3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,7 @@
* 2663 knuerr_rms_temp: switch to new generic temperature logic, allow e.g. lower
levels...
NOTE: Please refer to the migration notes!
* 2688 mssql agent plugin can now handle clustered MSSQL instances
+ * 2703 logwatch.ec: now transfers the service level to the event console...
* 2660 FIX: fixed windows agent using the wrong working directory...
* 2664 FIX: ps: Speedup in situation with many matching processes...
* 2661 FIX: windows agent: fixed incomplete process list...
diff --git a/checks/logwatch b/checks/logwatch
index 65c7d98..34e7707 100644
--- a/checks/logwatch
+++ b/checks/logwatch
@@ -731,7 +731,8 @@ def check_logwatch_ec(item, params, info):
continue
msg = '<%d>' % (facility + logwatch_to_prio(rclfd_level or
line[0]),)
- msg += '@%s %s %s: %s' % (cur_time, g_hostname, logfile, line[2:])
+ msg += '@%s;%d;; %s %s: "%s"' % (cur_time,
params.get("service_level", 0), g_hostname, logfile, line[2:])
+
messages.append(msg)
forwarded_logfiles.add(logfile)
@@ -800,6 +801,8 @@ def check_logwatch_ec(item, params, info):
def logwatch_ec_precompile(hostname, item, params):
params = params.copy()
+ params["service_level"] = get_effective_service_level()
+
# HACK: opt_keepalive is used to detect cmc
if (opt_keepalive or not params.get("logwatch_reclassify")):
params.update({"logwatch_patterns": []})
@@ -846,6 +849,7 @@ def logwatch_ec_precompile(hostname, item, params):
return params
precompile_params['logwatch.ec'] = logwatch_ec_precompile
+precompile_params['logwatch.ec_single'] = logwatch_ec_precompile
check_info['logwatch.ec'] = {
'check_function': check_logwatch_ec,