Module: check_mk
Branch: master
Commit: 6df4372aed7b8bb3cd3c17673138716a67a90969
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6df4372aed7b8b…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Aug 20 17:41:19 2014 +0200
#1145 FIX windows_tasks: handle case correctly where task is currently running
In some cases a Windows task reports state 267009. That was reported as {CRIT} but
in fact means that the task is currently running. It is reported as {OK} now.
---
.werks/1145 | 11 +++++++++++
ChangeLog | 1 +
checks/windows_tasks | 4 +++-
3 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/.werks/1145 b/.werks/1145
new file mode 100644
index 0000000..00a903e
--- /dev/null
+++ b/.werks/1145
@@ -0,0 +1,11 @@
+Title: windows_tasks: handle case correctly where task is currently running
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.5i6
+Date: 1408549221
+Class: fix
+
+In some cases a Windows task reports state 267009. That was reported as {CRIT} but
+in fact means that the task is currently running. It is reported as {OK} now.
+
diff --git a/ChangeLog b/ChangeLog
index 5fc97a5..c9d4a7a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -45,6 +45,7 @@
* 1143 FIX: dell_powerconnect_temp: fix configuration via WATO...
* 1144 FIX: blade_bx_temp, dell_chassis_temp, emerson_temp, ibm_svc_enclosurestats,
ups_bat_temp: rename service description...
NOTE: Please refer to the migration notes!
+ * 1145 FIX: windows_tasks: handle case correctly where task is currently running...
Multisite:
* 1066 Implemented Dashboard Designer...
diff --git a/checks/windows_tasks b/checks/windows_tasks
index 46aca6b..2e0c7d6 100644
--- a/checks/windows_tasks
+++ b/checks/windows_tasks
@@ -65,10 +65,12 @@ def check_windows_tasks(item, _no_params, info):
state = 0
label = ""
msg = []
- if last_result != 0:
+ if last_result not in [ 0, 0x00041301 ]: # SCHED_S_TASK_RUNNING
state = 2
label = "(!!)"
msg.append("Service in state: %s%s" % ( last_result, label ) )
+ if last_result == 0x00041301:
+ msg[-1] += " (currently running)"
if values['Scheduled Task State'] != 'Enabled':
msg.append("Task not Enabled(!!)")