Module: check_mk
Branch: master
Commit: b839005c5ce7e1e105218688d6dd7395fc46e1a2
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b839005c5ce7e1…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Jun 1 12:15:25 2016 +0200
3616 FIX Fix cmk -I ignoring the option --cache
When you use <tt>cmk --cache -I myhost123<tt> on the command line in order
to discovery services on a specific host then the option <tt>--cache</tt> was ignored
and always fresh data had been fetched from the target host. This has been
fixed.
---
.werks/3616 | 13 +++++++++++++
ChangeLog | 1 +
modules/discovery.py | 2 +-
3 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/.werks/3616 b/.werks/3616
new file mode 100644
index 0000000..166647b
--- /dev/null
+++ b/.werks/3616
@@ -0,0 +1,13 @@
+Title: Fix cmk -I ignoring the option --cache
+Level: 2
+Component: core
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.9i1
+Date: 1464776061
+
+When you use <tt>cmk --cache -I myhost123<tt> on the command line in order
+to discovery services on a specific host then the option <tt>--cache</tt> was ignored
+and always fresh data had been fetched from the target host. This has been
+fixed.
diff --git a/ChangeLog b/ChangeLog
index 6bf595a..2eb7e44 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -20,6 +20,7 @@
* 3416 FIX: Avoid warning in cmc.log when rescheduling non-existing discovery check...
* 3437 FIX: Improved performance of "activate changes", especially in distributed environments
* 3471 FIX: Repair ignoring discovery errors when bogus %s is contained in service description...
+ * 3616 FIX: Fix cmk -I ignoring the option --cache...
Checks & Agents:
* 3183 aruba_wlc_aps: new check which monitors the provisioned accesspoints of an Aruba Network WLAN Controller
diff --git a/modules/discovery.py b/modules/discovery.py
index 1001eaa..efbd8b8 100644
--- a/modules/discovery.py
+++ b/modules/discovery.py
@@ -43,7 +43,7 @@ import cmk.tty as tty
# hostnames is already prepared by the main code. If it is
# empty then we use all hosts and switch to using cache files.
def do_discovery(hostnames, check_types, only_new):
- use_caches = False
+ use_caches = opt_use_cachefile
if not hostnames:
verbose("Discovering services on all hosts:\n")
hostnames = all_active_realhosts()
Module: check_mk
Branch: master
Commit: fd1a1d461be2b8aacfb9f259e853d8fee0dcde5b
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fd1a1d461be2b8…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Wed Jun 1 11:55:04 2016 +0200
added description for match type list
---
web/htdocs/wato.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 1d9c0a6..069afdc 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -12594,7 +12594,7 @@ def explain_ruleset_match_type(rulespec):
html.write(_("The first matching rule defines the parameter."))
elif match_type == "dict":
html.write(_("Each parameter is defined by the first matching rule where that parameter is set (checked)."))
- elif match_type == "all":
+ elif match_type in ("all", "list"):
html.write(_("All matching rules will add to the resulting list."))
else:
html.write(_("Unknown match type: %s") % match_type)
Module: check_mk
Branch: master
Commit: 1c07b25b6a258d60452a2d94a4677b6a6ae5ca4d
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1c07b25b6a258d…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Wed Jun 1 11:40:57 2016 +0200
Fetched Livestatus from downstream plus associated fixes.
---
livestatus/src/Makefile.am | 1 +
livestatus/src/StringUtils.cc | 40 +++++++++++++++++++++++++++++
livestatus/src/StringUtils.h | 35 +++++++++++++++++++++++++
livestatus/src/TableEventConsole.cc | 2 +-
livestatus/src/TableEventConsoleEvents.cc | 5 ----
5 files changed, 77 insertions(+), 6 deletions(-)
diff --git a/livestatus/src/Makefile.am b/livestatus/src/Makefile.am
index ea5cd64..4177e9c 100644
--- a/livestatus/src/Makefile.am
+++ b/livestatus/src/Makefile.am
@@ -103,6 +103,7 @@ livestatus_so_SOURCES = \
Store.cc \
StringColumn.cc \
StringColumnFilter.cc \
+ StringUtils.cc \
Table.cc \
TableColumns.cc \
TableCommands.cc \
diff --git a/livestatus/src/StringUtils.cc b/livestatus/src/StringUtils.cc
new file mode 100644
index 0000000..92dfe58
--- /dev/null
+++ b/livestatus/src/StringUtils.cc
@@ -0,0 +1,40 @@
+// +------------------------------------------------------------------+
+// | ____ _ _ __ __ _ __ |
+// | / ___| |__ ___ ___| | __ | \/ | |/ / |
+// | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+// | | |___| | | | __/ (__| < | | | | . \ |
+// | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+// | |
+// | Copyright Mathias Kettner 2014 mk(a)mathias-kettner.de |
+// +------------------------------------------------------------------+
+//
+// This file is part of Check_MK.
+// The official homepage is at http://mathias-kettner.de/check_mk.
+//
+// check_mk is free software; you can redistribute it and/or modify it
+// under the terms of the GNU General Public License as published by
+// the Free Software Foundation in version 2. check_mk is distributed
+// in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
+// out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+// PARTICULAR PURPOSE. See the GNU General Public License for more de-
+// ails. You should have received a copy of the GNU General Public
+// License along with GNU Make; see the file COPYING. If not, write
+// to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+// Boston, MA 02110-1301 USA.
+
+#include "StringUtils.h"
+#include <algorithm>
+#include <cctype>
+
+using std::string;
+using std::transform;
+
+namespace mk {
+
+string unsafe_tolower(const string &str) {
+ string result = str;
+ transform(str.begin(), str.end(), result.begin(), ::tolower);
+ return result;
+}
+
+} // namespace
diff --git a/livestatus/src/StringUtils.h b/livestatus/src/StringUtils.h
new file mode 100644
index 0000000..1a81018
--- /dev/null
+++ b/livestatus/src/StringUtils.h
@@ -0,0 +1,35 @@
+// +------------------------------------------------------------------+
+// | ____ _ _ __ __ _ __ |
+// | / ___| |__ ___ ___| | __ | \/ | |/ / |
+// | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+// | | |___| | | | __/ (__| < | | | | . \ |
+// | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+// | |
+// | Copyright Mathias Kettner 2014 mk(a)mathias-kettner.de |
+// +------------------------------------------------------------------+
+//
+// This file is part of Check_MK.
+// The official homepage is at http://mathias-kettner.de/check_mk.
+//
+// check_mk is free software; you can redistribute it and/or modify it
+// under the terms of the GNU General Public License as published by
+// the Free Software Foundation in version 2. check_mk is distributed
+// in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
+// out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+// PARTICULAR PURPOSE. See the GNU General Public License for more de-
+// ails. You should have received a copy of the GNU General Public
+// License along with GNU Make; see the file COPYING. If not, write
+// to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+// Boston, MA 02110-1301 USA.
+
+#ifndef StringUtils_h
+#define StringUtils_h
+
+#include "config.h" // IWYU pragma: keep
+#include <string>
+
+namespace mk {
+std::string unsafe_tolower(const std::string &str);
+} // namespace
+
+#endif // StringUtils_h
diff --git a/livestatus/src/TableEventConsole.cc b/livestatus/src/TableEventConsole.cc
index de22b1c..e9dd5dc 100644
--- a/livestatus/src/TableEventConsole.cc
+++ b/livestatus/src/TableEventConsole.cc
@@ -266,7 +266,7 @@ bool TableEventConsole::receiveReply(int sock, Query *query) {
#ifdef CMC
row._host = (it == row._map.end() || _core == nullptr)
? nullptr
- : _core->_world->getHost(it->second);
+ : _core->_world->getHostByDesignation(it->second);
#else
// Older Nagios headers are not const-correct... :-P
row._host = it == row._map.end()
diff --git a/livestatus/src/TableEventConsoleEvents.cc b/livestatus/src/TableEventConsoleEvents.cc
index f5b1294..9dad91b 100644
--- a/livestatus/src/TableEventConsoleEvents.cc
+++ b/livestatus/src/TableEventConsoleEvents.cc
@@ -26,11 +26,6 @@
#include <string>
#include "Table.h"
#include "TableHosts.h"
-#ifdef CMC
-#include "Core.h"
-#include "World.h"
-using std::recursive_mutex;
-#endif
using std::string;