Module: check_mk
Branch: master
Commit: 4d55e5bde21ddf3de0cf52b05a96be86e60441e5
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4d55e5bde21ddf…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Sep 11 15:10:41 2014 +0200
#1398 Allow to spread times of next check when rescheduling
When you do the action <i>Reschedule active checks</i> for more than one
active checks then you now can enter a number of minutes. All checks will
then be distributed evenly over that time.
This feature is interesting for checks with larger intervals. Most prominent
example is the <tt>Check_MK Inventory</tt> check, which usually is done every
2, 4 or 24 hours. By spreading the executing of these checks you avoid large
peaks in CPU load.
---
.werks/1398 | 16 ++++++++++++++++
ChangeLog | 1 +
web/htdocs/views.py | 17 ++++++++++++-----
web/plugins/views/commands.py | 30 ++++++++++++++++++++++++------
4 files changed, 53 insertions(+), 11 deletions(-)
diff --git a/.werks/1398 b/.werks/1398
new file mode 100644
index 0000000..20148ee
--- /dev/null
+++ b/.werks/1398
@@ -0,0 +1,16 @@
+Title: Allow to spread times of next check when rescheduling
+Level: 2
+Component: multisite
+Compatible: compat
+Version: 1.2.5i6
+Date: 1410440913
+Class: feature
+
+When you do the action <i>Reschedule active checks</i> for more than one
+active checks then you now can enter a number of minutes. All checks will
+then be distributed evenly over that time.
+
+This feature is interesting for checks with larger intervals. Most prominent
+example is the <tt>Check_MK Inventory</tt> check, which usually is done every
+2, 4 or 24 hours. By spreading the executing of these checks you avoid large
+peaks in CPU load.
diff --git a/ChangeLog b/ChangeLog
index 5098f31..87bec08 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -92,6 +92,7 @@
Multisite:
* 1066 Implemented Dashboard Designer...
* 1392 WATO Folder filter: show only the paths a user is allowed to see
+ * 1398 Allow to spread times of next check when rescheduling...
* 1067 FIX: Fixed login problem in LDAP connector when no user filter specified...
* 1094 FIX: sidebar snaping 'Tree of folders': fixed exception
* 1154 FIX: Availability: Fixed unwanted redirect to edit annotation page after editing availability options...
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index d6ba10d..dfaa22f 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -1890,7 +1890,7 @@ def show_command_form(is_open, datasource):
# (host name, service description, downtime/commands id) and
# construct one or several core command lines and a descriptive
# title.
-def core_command(what, row):
+def core_command(what, row, row_nr, total_rows):
host = row.get("host_name")
descr = row.get("service_description")
@@ -1917,7 +1917,14 @@ def core_command(what, row):
# confirmation dialog.
for cmd in multisite_commands:
if config.may(cmd["permission"]):
- result = cmd["action"](cmdtag, spec, row)
+
+ # Does the command need information about the total number of rows
+ # and the number of the current row? Then specify that
+ if cmd.get("row_stats"):
+ result = cmd["action"](cmdtag, spec, row, row_nr, total_rows)
+ else:
+ result = cmd["action"](cmdtag, spec, row)
+
if result:
executor = cmd.get("executor", command_executor_livestatus)
commands, title = result
@@ -1965,14 +1972,14 @@ def do_actions(view, what, action_rows, backurl):
return False # no actions done
command = None
- title, executor = core_command(what, action_rows[0])[1:3] # just get the title and executor
+ title, executor = core_command(what, action_rows[0], 0, len(action_rows))[1:3] # just get the title and executor
if not html.confirm(_("Do you really want to %(title)s the following %(count)d %(what)s?") %
{ "title" : title, "count" : len(action_rows), "what" : _(what + "s"), }, method = 'GET'):
return False
count = 0
- for row in action_rows:
- core_commands, title, executor = core_command(what, row)
+ for nr, row in enumerate(action_rows):
+ core_commands, title, executor = core_command(what, row, nr, len(action_rows))
for command in core_commands:
if type(command) == unicode:
command = command.encode("utf-8")
diff --git a/web/plugins/views/commands.py b/web/plugins/views/commands.py
index 4cdc8ef..5f6cdb8 100644
--- a/web/plugins/views/commands.py
+++ b/web/plugins/views/commands.py
@@ -40,21 +40,39 @@
#file('/tmp/1', 'a').write('%s %s\n%s' % (datetime.datetime.now(), current_language, ''.join(traceback.format_stack())))
# RESCHEDULE ACTIVE CHECKS
+def command_reschedule(cmdtag, spec, row, row_nr, total_rows):
+ if html.var("_resched_checks"):
+ spread = saveint(html.var("_resched_spread"))
+ text = _("<b>reschedule an immediate check")
+ if spread:
+ text += _(" spreaded over %d minutes") % spread
+
+ text += "</b>" + _("of")
+
+ t = time.time()
+ if spread:
+ t += spread * 60.0 * row_nr / total_rows
+
+ command = "SCHEDULE_FORCED_" + cmdtag + "_CHECK;%s;%d" % (spec, int(t))
+ return command, text
+
config.declare_permission("action.reschedule",
_("Reschedule checks"),
_("Reschedule host and service checks"),
[ "user", "admin" ])
+
multisite_commands.append({
"tables" : [ "host", "service" ],
"permission" : "action.reschedule",
- "title" : _("Reschedule"),
+ "title" : _("Reschedule active checks"),
"render" : lambda: \
- html.button("_resched_checks", _("Reschedule active checks")),
- "action" : lambda cmdtag, spec, row:
- html.var("_resched_checks") and (
- "SCHEDULE_FORCED_" + cmdtag + "_CHECK;%s;%d" % (spec, int(time.time())),
- _("<b>reschedule an immediate check</b> of"))
+ html.button("_resched_checks", _("Reschedule")) == \
+ html.write(_("and spread over") + " ") == \
+ html.number_input("_resched_spread", 0, size=3) == \
+ html.write(" " + _("minutes") + " "),
+ "action" : command_reschedule,
+ "row_stats" : True, # Get information about number of rows and current row nr.
})
Module: check_mk
Branch: master
Commit: 2132af7799816aba34d4dc45347edc655e9c6e78
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2132af7799816a…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Thu Sep 11 14:18:54 2014 +0200
#1110 FIX windows agent: fixed missing agent section problem if a cached script ran into a timeout
If a cache_age was set for a local or plugin script and the script ran into a timeout,
no data was reported by this script until the cache_age was expired.
This lead to missing agent sections.
---
.werks/1110 | 11 +++++++++++
ChangeLog | 1 +
agents/windows/build_version | 2 +-
agents/windows/check_mk_agent-64.exe | Bin 208896 -> 208896 bytes
agents/windows/check_mk_agent-64.unversioned.exe | Bin 208896 -> 208896 bytes
agents/windows/check_mk_agent.cc | 2 +-
agents/windows/check_mk_agent.exe | Bin 178176 -> 178176 bytes
agents/windows/check_mk_agent.unversioned.exe | Bin 178176 -> 178176 bytes
agents/windows/install_agent-64.exe | Bin 160065 -> 160067 bytes
agents/windows/install_agent.exe | Bin 156986 -> 156984 bytes
10 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/.werks/1110 b/.werks/1110
new file mode 100644
index 0000000..109b8c5
--- /dev/null
+++ b/.werks/1110
@@ -0,0 +1,11 @@
+Title: windows agent: fixed missing agent section problem if a cached script ran into a timeout
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.5i6
+Date: 1410437655
+Class: fix
+
+If a cache_age was set for a local or plugin script and the script ran into a timeout,
+no data was reported by this script until the cache_age was expired.
+This lead to missing agent sections.
diff --git a/ChangeLog b/ChangeLog
index 5098f31..ddd3a5d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -88,6 +88,7 @@
* 1393 FIX: casa_cpu_temp, casa_cpu_util: Change service description to standard...
NOTE: Please refer to the migration notes!
* 1104 FIX: winperf_if: Improved matching of data from wmic_if.bat / wmic_if.ps1 scripts...
+ * 1110 FIX: windows agent: fixed missing agent section problem if a cached script ran into a timeout...
Multisite:
* 1066 Implemented Dashboard Designer...
diff --git a/agents/windows/build_version b/agents/windows/build_version
index 8643cf6..7fe4e49 100644
--- a/agents/windows/build_version
+++ b/agents/windows/build_version
@@ -1 +1 @@
-89
+91
diff --git a/agents/windows/check_mk_agent-64.exe b/agents/windows/check_mk_agent-64.exe
index 2262cd3..9cda56e 100755
Binary files a/agents/windows/check_mk_agent-64.exe and b/agents/windows/check_mk_agent-64.exe differ
diff --git a/agents/windows/check_mk_agent-64.unversioned.exe b/agents/windows/check_mk_agent-64.unversioned.exe
index 752375a..6fa477c 100755
Binary files a/agents/windows/check_mk_agent-64.unversioned.exe and b/agents/windows/check_mk_agent-64.unversioned.exe differ
diff --git a/agents/windows/check_mk_agent.cc b/agents/windows/check_mk_agent.cc
index dd9569b..7cae6c1 100755
--- a/agents/windows/check_mk_agent.cc
+++ b/agents/windows/check_mk_agent.cc
@@ -2809,6 +2809,7 @@ DWORD WINAPI ScriptWorkerThread(LPVOID lpParam)
cont->status = SCRIPT_FINISHED;
cont->last_problem = SCRIPT_NONE;
cont->retry_count = cont->max_retries;
+ cont->buffer_time = time(0);
break;
case 1:
cont->status = SCRIPT_ERROR;
@@ -2858,7 +2859,6 @@ void run_script_container(script_container *cont)
if (cont->status == SCRIPT_COLLECT || cont->status == SCRIPT_FINISHED) {
return;
}
- cont->buffer_time = time(0);
cont->status = SCRIPT_COLLECT;
if (cont->worker_thread != INVALID_HANDLE_VALUE)
diff --git a/agents/windows/check_mk_agent.exe b/agents/windows/check_mk_agent.exe
index 1ff882a..27826ec 100755
Binary files a/agents/windows/check_mk_agent.exe and b/agents/windows/check_mk_agent.exe differ
diff --git a/agents/windows/check_mk_agent.unversioned.exe b/agents/windows/check_mk_agent.unversioned.exe
index c27128f..8a10df5 100755
Binary files a/agents/windows/check_mk_agent.unversioned.exe and b/agents/windows/check_mk_agent.unversioned.exe differ
diff --git a/agents/windows/install_agent-64.exe b/agents/windows/install_agent-64.exe
index fc4de25..e7e29ec 100755
Binary files a/agents/windows/install_agent-64.exe and b/agents/windows/install_agent-64.exe differ
diff --git a/agents/windows/install_agent.exe b/agents/windows/install_agent.exe
index dff5540..a018288 100755
Binary files a/agents/windows/install_agent.exe and b/agents/windows/install_agent.exe differ
Module: check_mk
Branch: master
Commit: 74f4ae5638eec57f9d36a7b733efd9cabdbfec61
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=74f4ae5638eec5…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Thu Sep 11 12:01:41 2014 +0200
Only for testing: bluecat_threads
---
checks/bluecat_threads | 55 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 55 insertions(+)
diff --git a/checks/bluecat_threads b/checks/bluecat_threads
new file mode 100644
index 0000000..6539445
--- /dev/null
+++ b/checks/bluecat_threads
@@ -0,0 +1,55 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2013 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.
+
+
+threads_default_levels = (2000, 4000)
+
+def inventory_bluecat_threads(info):
+ return [(None, "threads_default_levels")]
+
+def check_bluecat_threads(item, params, info):
+ nthreads = int(info[0][0])
+ warn, crit = params
+ perfdata = [('threads', nthreads, warn, crit, 0 )]
+ if nthreads >= crit:
+ return (2, "%d threads (critical at %d)" % (nthreads, crit), perfdata)
+ elif nthreads >= warn:
+ return (1, "%d threads (warning at %d)" % (nthreads, warn), perfdata)
+ else:
+ return (0, "%d threads" % (nthreads,), perfdata)
+
+check_info["bluecat_threads"] = {
+ "check_function" : check_bluecat_threads,
+ "inventory_function" : inventory_bluecat_threads,
+ "service_description" : "Number of threads",
+ "group" : "threads",
+ "has_perfdata" : True,
+ "snmp_scan_function" : lambda oid: oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.13315.2.1"),
+ "snmp_info" : (".1.3.6.1.4.1.13315.100.200.1.1.2", [
+ 1, # activeThreadCount
+ ])
+}
+
Module: check_mk
Branch: master
Commit: 3d8e8841b12a32ce8775320ad3a1f69909d25630
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3d8e8841b12a32…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Sep 11 09:27:45 2014 +0200
Updated bug entries #2182
---
.bugs/2182 | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/.bugs/2182 b/.bugs/2182
new file mode 100644
index 0000000..25c255a
--- /dev/null
+++ b/.bugs/2182
@@ -0,0 +1,10 @@
+Title: Host diagnostic page: warn/show agent types that are not configured
+Component: wato
+State: open
+Date: 2014-09-11 09:26:46
+Targetversion: future
+Class: nastiness
+
+Example: In the host there is configured 'No Agent'. Then in the diagnostig
+page in the section for the agent output there should be a warning, that
+this output is not being used! For SNMP we can do the same.