Module: check_mk
Branch: master
Commit: ba90fa9691746255daa8b364152c6b8d1493df24
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ba90fa96917462…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Apr 17 16:56:40 2014 +0200
Better inline docu in mail notification script
---
notifications/mail | 1 +
1 file changed, 1 insertion(+)
diff --git a/notifications/mail b/notifications/mail
index c051b73..11a4c32 100755
--- a/notifications/mail
+++ b/notifications/mail
@@ -4,6 +4,7 @@
#
# Argument 1: Full system path to the pnp4nagios index.php for fetching the graphs. Usually auto configured in OMD.
# Argument 2: HTTP-URL-Prefix to open Multisite. When provided, several links are added to the mail.
+# Example: http://myserv01/prod
#
# This script creates a nifty HTML email in multipart format with
# attached graphs and such neat stuff. Sweet!
Module: check_mk
Branch: master
Commit: 09be677103d3c2dfbdb2c3277f5222b1c5db4d02
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=09be677103d3c2…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Apr 22 08:33:52 2014 +0200
Updated bug entries #2128
---
.bugs/2128 | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/.bugs/2128 b/.bugs/2128
new file mode 100644
index 0000000..5dd4bef
--- /dev/null
+++ b/.bugs/2128
@@ -0,0 +1,10 @@
+Title: mk-job: Start time is only available after job finished
+Component: checks
+State: open
+Date: 2014-04-22 08:32:35
+Targetversion: 1.2.5i1
+Class: bug
+
+This should really be changed. The start time should be available once the job has been
+started. The check needs to deal with the old job info and the start time of the just
+started and currently running job while the job is running.
Module: check_mk
Branch: master
Commit: e75347fdb48fc5be804938e2b19982bdb93fe6fb
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e75347fdb48fc5…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Thu Apr 17 16:17:48 2014 +0200
FIX windows_updates: Added Error Handling (Thanks to Stefan Kick)
The windows_update plugin now also handles windows servers with deactivated update function.
---
.werks/152 | 8 ++++++++
ChangeLog | 1 +
agents/windows/plugins/windows_updates.vbs | 15 ++++++++++++++-
checks/windows_updates | 3 +++
4 files changed, 26 insertions(+), 1 deletion(-)
diff --git a/.werks/152 b/.werks/152
new file mode 100644
index 0000000..bed4540
--- /dev/null
+++ b/.werks/152
@@ -0,0 +1,8 @@
+Title: windows_updates: Added Error Handling (Thanks to Stefan Kick)
+Level: 1
+Component: checks
+Version: 1.2.5i3
+Date: 1397744176
+Class: fix
+
+The windows_update plugin now also handles windows servers with deactivated update function.
diff --git a/ChangeLog b/ChangeLog
index b34156d..477451c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -44,6 +44,7 @@
* 0882 FIX: check_bi_local.py: fix crash in case of non-ascii characters...
* 0606 FIX: apache_status: now also sends an accept header to make it work with mod_security enables servers
* 0832 FIX: solaris_mem: fixed invalid calculation of total swap...
+ * 0152 FIX: windows_updates: Added Error Handling (Thanks to Stefan Kick)...
Multisite:
* 0779 Hostgroups (Summary): Empty hostgroups are no longer shown (can be re-enabled by filter)
diff --git a/agents/windows/plugins/windows_updates.vbs b/agents/windows/plugins/windows_updates.vbs
index 7ef05df..596fce4 100644
--- a/agents/windows/plugins/windows_updates.vbs
+++ b/agents/windows/plugins/windows_updates.vbs
@@ -6,7 +6,7 @@
' to a new inventorized service.
'
' Author: Lars Michelsen <lm(a)mathias-kettner.de>, 2011-03-21
-' Editor: Patrick Schlüter <ps(a)pdv-systeme.de>, 2011-08-21
+' Editor: Patrick SchlÃŒter <ps(a)pdv-systeme.de>, 2011-08-21
'
' Updated by Phil Randal, 2012-09-21, to cache results using a randomised check interval
' of 16 to 24 hours
@@ -16,6 +16,8 @@
'
' Updated by Bastian Kuhn, 2014-03-03: Removed all caching functions cause the current agent
' has a native caching support. Make sure that you activate caching for this script in check_mk.ini
+'
+' 2014-04-17: Fix by Stefan Kick to handle errors. Payed by Adaptron.
' -----------------------------------------------------------------------------------------
Option Explicit
@@ -64,7 +66,18 @@ If CreateObject("Microsoft.Update.SystemInfo").RebootRequired Then
reboot = 1
End If
+On Error Resume Next
+
Set result = updtSearcher.Search("IsInstalled = 0 and IsHidden = 0")
+
+If Err.Number <> 0 then
+ WScript.Echo "<<<windows_updates>>>"
+ Wscript.Echo "x x x"
+ Wscript.Echo "There was an error getting update information. Maybe Windows update is not activated. Error Number: " & Err.Number
+ WScript.Quit()
+End If
+
+
Set colDownloads = result.Updates
For Each objEntry in colDownloads
diff --git a/checks/windows_updates b/checks/windows_updates
index 1a6c153..9f04829 100644
--- a/checks/windows_updates
+++ b/checks/windows_updates
@@ -47,6 +47,9 @@ def inventory_windows_updates(info):
def check_windows_updates(_unused, params, info):
if info and len(info[0]) == 3:
status = 0
+ # Workarround to return errors from the plugin
+ if info[0][0] == 'x':
+ return 2, ' '.join(info[1])
reboot_required, num_imp, num_opt = map(saveint, info[0])
imp_warn, imp_crit, opt_warn, opt_crit = params[0:4]
if len(params) == 7: