Module: check_mk
Branch: master
Commit: 85ad58757d3e10734bb738712e373e1aa3c825e3
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=85ad58757d3e10…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Apr 19 11:22:43 2016 +0200
3386 FIX AIX agent: Cached local scripts / plugins need to be configured in seconds
When using cached executin of local scripts or agent plugins (putting scripts
in subdirectories named like the execution interval) with the AIX agent, the
directory names were interpreted as minutes which was not consistent with the
other agents.
This has now been changed to be consistently interpreted as seconds. You will
have to rename your directories to the current name multiplied with 60 to
execute the plugins again in the expected interval.
---
.werks/3386 | 16 ++++++++++++++++
ChangeLog | 2 ++
agents/check_mk_agent.aix | 4 +++-
3 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/.werks/3386 b/.werks/3386
new file mode 100644
index 0000000..46fa75d
--- /dev/null
+++ b/.werks/3386
@@ -0,0 +1,16 @@
+Title: AIX agent: Cached local scripts / plugins need to be configured in seconds
+Level: 2
+Component: checks
+Compatible: incomp
+Version: 1.2.9i1
+Date: 1461057535
+Class: fix
+
+When using cached executin of local scripts or agent plugins (putting scripts
+in subdirectories named like the execution interval) with the AIX agent, the
+directory names were interpreted as minutes which was not consistent with the
+other agents.
+
+This has now been changed to be consistently interpreted as seconds. You will
+have to rename your directories to the current name multiplied with 60 to
+execute the plugins again in the expected interval.
diff --git a/ChangeLog b/ChangeLog
index 3dcd5bb..bd461ca 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -159,6 +159,8 @@
* 3399 FIX: statgrab_mem, hr_mem: Fix display of total installed memory in graph
* 3384 FIX: eltek_battery: Fixed broken check due to wrong spelled include file
* 3400 FIX: local: do not crash in P mode if performance data contains a unit of measurement
+ * 3386 FIX: AIX agent: Cached local scripts / plugins need to be configured in seconds...
+ NOTE: Please refer to the migration notes!
Multisite:
* 3187 notification view: new filter for log command via regex
diff --git a/agents/check_mk_agent.aix b/agents/check_mk_agent.aix
index db5e022..6dd5136 100755
--- a/agents/check_mk_agent.aix
+++ b/agents/check_mk_agent.aix
@@ -91,10 +91,12 @@ function waitmax
function run_cached {
NAME=$1
+ # Be aware: Maxage was expected to be given in minutes but this was
+ # confusing because all other agents use seconds here. So this has
+ # been changed to be compatible.
MAXAGE=$2
shift 2
CMDLINE=$*
- MAXAGE=$MAXAGE*60
if [ ! -e $MK_VARDIR/cache ] ; then mkdir -p $MK_VARDIR/cache ; fi
CACHE_FILE=$MK_VARDIR/cache/$NAME.cache
Module: check_mk
Branch: master
Commit: e30e46c7680fdf15731677414ca573cf6482f6c2
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e30e46c7680fdf…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Apr 19 10:21:55 2016 +0200
Added a not about BI not using hard states in availability
---
web/plugins/wato/bi.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/web/plugins/wato/bi.py b/web/plugins/wato/bi.py
index 119126b..6b30aad 100644
--- a/web/plugins/wato/bi.py
+++ b/web/plugins/wato/bi.py
@@ -637,7 +637,9 @@ class ModeBI(WatoMode):
help = _("Hard states can only differ from soft states if at least one host or service "
"of the BI aggregate has more than 1 maximum check attempt. For example if you "
"set the maximum check attempts of a service to 3 and the service is CRIT "
- "just since one check then it's soft state is CRIT, but its hard state is still OK."),
+ "just since one check then it's soft state is CRIT, but its hard state is still OK. "
+ "<b>Note:</b> When computing the availbility of a BI aggregate this option "
+ "has no impact. For that purpose always the soft (i.e. real) states will be used."),
)
),
( "downtime_aggr_warn",
Module: check_mk
Branch: master
Commit: ec5cff82a53abfe1d011bf186693a9c762cd411b
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ec5cff82a53abf…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Apr 19 10:21:31 2016 +0200
3385 FIX Fixed not updated discovery service after grouped auto discovery
When the automatic service discovery and activation updates the services
of a host the "Check_MK Discovery" service remained in the state it was
before the discovery. This has now been fixed by triggering a refresh
of the discovery services.
---
.werks/3385 | 13 +++++++++++++
ChangeLog | 1 +
modules/automation.py | 18 ------------------
modules/check_mk.py | 18 ++++++++++++++++++
modules/discovery.py | 3 +++
5 files changed, 35 insertions(+), 18 deletions(-)
diff --git a/.werks/3385 b/.werks/3385
new file mode 100644
index 0000000..c84e919
--- /dev/null
+++ b/.werks/3385
@@ -0,0 +1,13 @@
+Title: Fixed not updated discovery service after grouped auto discovery
+Level: 1
+Component: core
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.9i1
+Date: 1461054017
+
+When the automatic service discovery and activation updates the services
+of a host the "Check_MK Discovery" service remained in the state it was
+before the discovery. This has now been fixed by triggering a refresh
+of the discovery services.
diff --git a/ChangeLog b/ChangeLog
index fd0c969..3dcd5bb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -14,6 +14,7 @@
* 3343 FIX: MKP: Verifying minimal version of packages during installation...
* 3349 FIX: Added rule to disable Inline-SNMP per host...
* 3123 FIX: fix for temperature services discovered pre-1.2.8 that caused errors on writing configuration
+ * 3385 FIX: Fixed not updated discovery service after grouped auto discovery...
Checks & Agents:
* 3183 aruba_wlc_aps: new check which monitors the provisioned accesspoints of an Aruba Network WLAN Controller
diff --git a/modules/automation.py b/modules/automation.py
index 18d7ee0..13deccd 100644
--- a/modules/automation.py
+++ b/modules/automation.py
@@ -254,24 +254,6 @@ def automation_get_autochecks(args):
return result
-def schedule_inventory_check(hostname):
- try:
- import socket
- s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
- s.connect(livestatus_unix_socket)
- now = int(time.time())
- if 'cmk-inventory' in use_new_descriptions_for:
- command = "SCHEDULE_FORCED_SVC_CHECK;%s;Check_MK Discovery;%d" % (hostname, now)
- else:
- # FIXME: Remove this old name handling one day
- command = "SCHEDULE_FORCED_SVC_CHECK;%s;Check_MK inventory;%d" % (hostname, now)
- s.send("COMMAND [%d] %s\n" % (now, command))
- except Exception, e:
- if opt_debug:
- raise
-
-
-
# Determine the type of the check, and how the parameters are being
# constructed
def automation_analyse_service(args):
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 8e6ff18..bff1197 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -1493,6 +1493,24 @@ def restore_original_agent_caching_usage():
orig_cluster_max_cachefile_age = None
orig_inventory_max_cachefile_age = None
+
+def schedule_inventory_check(hostname):
+ try:
+ import socket
+ s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
+ s.connect(livestatus_unix_socket)
+ now = int(time.time())
+ if 'cmk-inventory' in use_new_descriptions_for:
+ command = "SCHEDULE_FORCED_SVC_CHECK;%s;Check_MK Discovery;%d" % (hostname, now)
+ else:
+ # TODO: Remove this old name handling one day
+ command = "SCHEDULE_FORCED_SVC_CHECK;%s;Check_MK inventory;%d" % (hostname, now)
+ s.send("COMMAND [%d] %s\n" % (now, command))
+ except Exception, e:
+ if opt_debug:
+ raise
+
+
#.
# .--SNMP----------------------------------------------------------------.
# | ____ _ _ __ __ ____ |
diff --git a/modules/discovery.py b/modules/discovery.py
index c4c5aeb..59f25ab 100644
--- a/modules/discovery.py
+++ b/modules/discovery.py
@@ -466,6 +466,9 @@ def discover_marked_hosts():
if redisc_params["activation"]:
activation_required = True
+ # Now ensure that the discovery service is updated right after the changes
+ schedule_inventory_check(hostname)
+
# delete the file even in error case, otherwise we might be causing the same error
# every time the cron job runs
os.remove(host_flag_path)
Module: check_mk
Branch: master
Commit: aa44a7a1e2cc2c65514ea342b71244df06671c5b
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=aa44a7a1e2cc2c…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Apr 18 17:03:02 2016 +0200
Cleaned up counter wrap handling a bit
---
modules/check_mk_base.py | 10 ++++++++--
modules/discovery.py | 3 +--
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index 84df17f..167fd94 100644
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -1149,10 +1149,16 @@ def reset_wrapped_counters():
g_last_counter_wrap = None
+# TODO: Can we remove this? (check API)
def last_counter_wrap():
return g_last_counter_wrap
+def raise_counter_wrap():
+ if g_last_counter_wrap:
+ raise g_last_counter_wrap # pylint: disable=raising-bad-type
+
+
# Compute average by gliding exponential algorithm
# itemname : unique ID for storing this average until the next check
# this_time : timestamp of new value
@@ -1490,8 +1496,7 @@ def do_all_checks_on_host(hostname, ipaddress, only_check_types = None, fetch_ag
raise Exception(str(info))
result = sanitize_check_result(check_function(item, params, info), check_uses_snmp(checkname))
- if last_counter_wrap():
- raise last_counter_wrap()
+ raise_counter_wrap()
# handle check implementations that do not yet support the
@@ -1661,6 +1666,7 @@ def create_crash_dump_info_file(crash_dir, hostname, check_type, item, params, d
# reporting it is totally ok to have some string representations of the objects.
class RobustJSONEncoder(json.JSONEncoder):
# Are there cases where no __str__ is available? if so, we should do something like %r
+ # pylint: disable=method-hidden
def default(self, o):
return "%s" % o
diff --git a/modules/discovery.py b/modules/discovery.py
index 95300f3..c4c5aeb 100644
--- a/modules/discovery.py
+++ b/modules/discovery.py
@@ -1044,8 +1044,7 @@ def get_check_preview(hostname, use_caches, do_snmp_scan, on_error):
try:
reset_wrapped_counters()
result = sanitize_check_result(check_function(item, params, info), check_uses_snmp(check_type))
- if last_counter_wrap():
- raise last_counter_wrap()
+ raise_counter_wrap()
except MKCounterWrapped, e:
result = (None, "WAITING - Counter based check, cannot be done offline")
except Exception, e: