no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | monitors:winupd [2009/11/23 06:12] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Windows Update Check ====== | ||
+ | |||
+ | ^ Author | [[ plennon@automated-knowledge.com | Padraig Lennon ]] | | ||
+ | ^ Compatibility | Xymon 4.2+ | | ||
+ | ^ Requirements | Windows Update API (Should be installed by default) | | ||
+ | ^ Download | winupd.vbs | | ||
+ | ^ Last Update | 2009-06-26 | | ||
+ | |||
+ | ===== Description ===== | ||
+ | Simple check to see if there are any pending reboot required to finish applying system updates (patches) | ||
+ | |||
+ | ===== Installation ===== | ||
+ | Copy the code below to a file called **winupd.vbs** in the **BBWIN_HOME/ | ||
+ | |||
+ | Add the following to bbwin.cfg in the **< | ||
+ | < | ||
+ | <load value=" | ||
+ | </ | ||
+ | |||
+ | === Client side === | ||
+ | |||
+ | === Server side === | ||
+ | |||
+ | ===== Source ===== | ||
+ | ==== winupd.vbs ==== | ||
+ | <hidden onHidden=" | ||
+ | < | ||
+ | ' | ||
+ | ' NAME: Windows Update Check | ||
+ | ' COMMENT: Simple Check for Pending Reboots to finish applying updates | ||
+ | ' AUTHOR: Padraig Lennon | ||
+ | ' EMAIL: padraig.lennon@pioneerinvestments.com | ||
+ | ' HISTORY | ||
+ | ' VERSION : 1.00 25/06/2009 Initial Development | ||
+ | ' Requires : No Requirements at present | ||
+ | ' | ||
+ | |||
+ | On Error Resume Next | ||
+ | |||
+ | Dim objShell | ||
+ | Dim typelib, | ||
+ | Dim strLayout, | ||
+ | |||
+ | ' Set Variables and get the Server Name | ||
+ | Set objShell = WScript.CreateObject(" | ||
+ | |||
+ | |||
+ | ServerName = objShell.ExpandEnvironmentStrings(" | ||
+ | |||
+ | ' User definable section | ||
+ | |||
+ | strTestName = " | ||
+ | |||
+ | strAlarmState = " | ||
+ | strOutput | ||
+ | |||
+ | Set oShell = WScript.CreateObject(" | ||
+ | ' Check to see If used with BBWin or Big Brother client and set extPath. | ||
+ | extPath = oShell.RegRead(" | ||
+ | If extPath = "" | ||
+ | extPath = oShell.RegRead(" | ||
+ | End If | ||
+ | |||
+ | |||
+ | ' ======================================== | ||
+ | ' Main Code Starts Here | ||
+ | |||
+ | strOutput = strOutput & vbcrlf & "< | ||
+ | |||
+ | Set objSysInfo = CreateObject(" | ||
+ | |||
+ | If objSysInfo.RebootRequired Then | ||
+ | strAlarmState = " | ||
+ | strOutput = strOutput & vbcrlf & "&" | ||
+ | Else | ||
+ | strAlarmState = " | ||
+ | strOutput = strOutput & vbcrlf & "&" | ||
+ | End If | ||
+ | |||
+ | |||
+ | ' Write the file for BB | ||
+ | WriteFile extPath, strTestName, | ||
+ | |||
+ | ' | ||
+ | ' FUNCTIONS and SUBS start here | ||
+ | |||
+ | ' This SUB is used for outputting the file to the external' | ||
+ | SUB WriteFile(strExtPath, | ||
+ | Set fso = CreateObject(" | ||
+ | strOutput = strAlarmState & " " & Date & " " & LCase(Time) & " " & LCase(ServerName) & vbcrlf & strOutput & vbcrlf | ||
+ | Set f = fso.OpenTextFile(strExtPath & " | ||
+ | f.Write strOutput | ||
+ | f.Close | ||
+ | Set fso = Nothing | ||
+ | END Sub | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ===== Known Bugs and Issues ===== | ||
+ | None known at present | ||
+ | |||
+ | ===== To Do ===== | ||
+ | * Enhance to check for outstanding critical updates not applied | ||
+ | * Allow configurable thresholds for outstanding patches before alerting | ||
+ | |||
+ | ===== Credits ===== | ||
+ | |||
+ | ===== Changelog ===== | ||
+ | |||
+ | * **2009-06-26** | ||
+ | * Initial release | ||