Module: check_mk
Branch: master
Commit: 50c7cc68a917208ff87a4b2910add645e95ff675
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=50c7cc68a91720…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Aug 22 10:42:08 2016 +0200
3761 FIX windows_tasks: Fixed possible exception in discovery in case of unexpected agent
data
---
.werks/3761 | 10 ++++++++++
ChangeLog | 1 +
checks/windows_tasks | 2 +-
3 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/.werks/3761 b/.werks/3761
new file mode 100644
index 0000000..d72f78b
--- /dev/null
+++ b/.werks/3761
@@ -0,0 +1,10 @@
+Title: windows_tasks: Fixed possible exception in discovery in case of unexpected agent
data
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.4.0i1
+Date: 1471855297
+
+
diff --git a/ChangeLog b/ChangeLog
index 54d8a51..fec20c5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -341,6 +341,7 @@
* 3773 FIX: check_http: fixed proxy authentication
* 3782 FIX: agent_netapp: fixed exception with values containing umlauts
* 3774 FIX: apc_symmetra: fixed wrong status and values handling
+ * 3761 FIX: windows_tasks: Fixed possible exception in discovery in case of
unexpected agent data
Multisite:
* 3187 notification view: new filter for log command via regex
diff --git a/checks/windows_tasks b/checks/windows_tasks
index 2f8af8f..2cdcbbe 100644
--- a/checks/windows_tasks
+++ b/checks/windows_tasks
@@ -71,7 +71,7 @@ def windows_tasks_convert(info):
def inventory_windows_tasks(info):
info = windows_tasks_convert(info)
- return [ (n, None) for n, v in info.items() if v['Scheduled Task State'] ==
"Enabled"]
+ return [ (n, None) for n, v in info.items() if v.get('Scheduled Task State')
== "Enabled"]
def check_windows_tasks(item, _no_params, info):
info = windows_tasks_convert(info)