Module: check_mk
Branch: master
Commit: ff354002d0d69998e33459267a327e6fc1bc328f
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ff354002d0d699…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Apr 9 12:54:03 2014 +0200
windows_tasks: output last and next run time
---
.werks/879 | 8 ++++++++
ChangeLog | 3 ++-
checks/windows_tasks | 29 ++++++++++++++++++-----------
3 files changed, 28 insertions(+), 12 deletions(-)
diff --git a/.werks/879 b/.werks/879
new file mode 100644
index 0000000..58ea5db
--- /dev/null
+++ b/.werks/879
@@ -0,0 +1,8 @@
+Title: windows_tasks: output last and next run time
+Level: 1
+Component: checks
+Version: 1.2.5i3
+Date: 1397040831
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index d064fba..b4f7ed5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -18,14 +18,15 @@
* 0602 cmciii.humidity: new check for Rittals CMC III humidity sensors
* 0829 oracle_tablespaces: improved formatting of levels text in check output...
* 0757 Linux multipath check can now use the alias instead of the UUID as item...
+ * 0879 windows_tasks: output last and next run time
* 0777 FIX: special agent emcvnx: did not work with security file authentication...
* 0786 FIX: zfsget: fixed compatibility with older Solaris agents...
* 0809 FIX: brocade_fcport: Fixed recently introduced problem with port speed
detection
* 0787 FIX: df: fixed problems on some filesystem checks when legacy check parameters
where used...
- * 0603 FIX: cmciii checks: more general scan function plus perf-o-meters for humidity
and temperature checks
* 0803 FIX: agent_ibmsvc: raw data for System Info Check and License Check now in
correct format...
* 0788 FIX: oracle_tablespaces: now able to bear None values as warn/crit levels...
* 0789 FIX: oracle_tablespaces: fixed bug when using dynamic filesystem levels...
+ * 0603 FIX: cmciii checks: more general scan function plus perf-o-meters for humidity
and temperature checks
Multisite:
* 0779 Hostgroups (Summary): Empty hostgroups are no longer shown (can be re-enabled
by filter)
diff --git a/checks/windows_tasks b/checks/windows_tasks
index 7aec0c7..46aca6b 100644
--- a/checks/windows_tasks
+++ b/checks/windows_tasks
@@ -25,17 +25,18 @@
# Boston, MA 02110-1301 USA.
# Example output from agent:
-#TaskName : \WebShopPictureUpload
-#Last Run Time : 17.10.2013 23:00:00
-#Next Run Time : 18.10.2013 23:00:00
-#Last Result : 0
-#Scheduled Task State : Enabled
+# <<<windows_tasks:sep(58)>>>
+# TaskName : \WebShopPictureUpload
+# Last Run Time : 17.10.2013 23:00:00
+# Next Run Time : 18.10.2013 23:00:00
+# Last Result : 0
+# Scheduled Task State : Enabled
#
-#TaskName : \OfficeSoftwareProtectionPlatform\SvcRestartTask
-#Last Run Time : N/A
-#Next Run Time : Disabled
-#Last Result : 1
-#Scheduled Task State : Disabled
+# TaskName : \OfficeSoftwareProtectionPlatform\SvcRestartTask
+# Last Run Time : N/A
+# Next Run Time : Disabled
+# Last Result : 1
+# Scheduled Task State : Disabled
def windows_tasks_convert(info):
@@ -43,7 +44,7 @@ def windows_tasks_convert(info):
last_task = False
for line in info:
name = line[0].strip()
- value = "".join(line[1:]).strip()
+ value = ":".join(line[1:]).strip()
if last_task and name != "TaskName":
data[last_task][name] = value
@@ -73,6 +74,12 @@ def check_windows_tasks(item, _no_params, info):
msg.append("Task not Enabled(!!)")
state = 2
+ if "Last Run Time" in values:
+ msg.append("last run time: %s" % values["Last Run
Time"])
+
+ if "Next Run Time" in values:
+ msg.append("next run time: %s" % values["Next Run
Time"])
+
return state, ", ".join(msg)
return 3, "Task not found on server"