Module: check_mk
Branch: master
Commit: 6458511ac6f7fe0aaa5ee19ed138d3d94f0f93b1
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6458511ac6f7fe…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Mon Mar 13 13:31:21 2017 +0100
Fixed event console command forwarding with nagios core.
Change-Id: I3a2f0eebd7e897755d1896dd87b98ee4cfee9942
---
livestatus/src/Store.cc | 22 +++++++++-------------
1 file changed, 9 insertions(+), 13 deletions(-)
diff --git a/livestatus/src/Store.cc b/livestatus/src/Store.cc
index 61528e1..abed132 100644
--- a/livestatus/src/Store.cc
+++ b/livestatus/src/Store.cc
@@ -243,26 +243,22 @@ bool Store::handleCommand(const string &command) {
// COMMAND [1462191638] MK_LOGWATCH_ACKNOWLEDGE;host123;\var\log\syslog
if (parts.size() != 3) {
Warning(_logger) << "MK_LOGWATCH_ACKNOWLEDGE expects 2
arguments";
- return false;
+ } else {
+ extern char g_mk_logwatch_path[];
+ mk_logwatch_acknowledge(_logger, g_mk_logwatch_path, parts[1],
+ parts[2]);
}
- extern char g_mk_logwatch_path[];
- mk_logwatch_acknowledge(_logger, g_mk_logwatch_path, parts[1],
- parts[2]);
return true;
}
if (starts_with(command_name, "EC_")) {
- if (parts.size() != 1) {
- Warning(_logger) << command_name << "expects 0
arguments";
- return false;
- }
- if (_core->mkeventdEnabled()) {
- ECTableConnection(_logger, _core->mkeventdSocketPath(),
- "COMMAND " + command_name.substr(3))
- .run();
- } else {
+ if (!_core->mkeventdEnabled()) {
Notice(_logger) << "event console disabled, ignoring command
'"
<< command << "'";
+ } else {
+ ECTableConnection(_logger, _core->mkeventdSocketPath(),
+ "COMMAND " + command.substr(3))
+ .run();
}
return true;
}