Build precise queries to find exactly what you need
Press ESC to close
Your review has been submitted and is pending approval.
Neat VBscript to check if windows machines require an update (and/or a subsequent reboot). Windows 7 and 10 and others maybe ;-)
Current Version
1.0
Last Release Date
2018-06-29
Owner
Martin Scharm
Website
https://github.com/binfalse/check_win_updates
Download URL
https://github.com/binfalse/check_win_updates/raw/master/check_win_updates.wsf
License
GPL
Compatible With
<h2>Check for Updates</h2>
To check for updates, this script creates an update searcher of an <code>Microsoft.Update.Session</code> object and filters for updates, which are
<ul> <li> assigned to the machine (IsAssigned=1)</li> <li> are not hidden to the users (IsHidden=0)</li> <li> are not yet installed (IsInstalled=0)</li> </ul> In case of matches, it outputs the number of uninstalled updates and list the details as performance data.
<h2>Check for Reboot</h2>
The check for required reboots is performed using an <code>Microsoft.Update.SystemInfo</code> object.
<h2>Installation</h2>
The installation of course depends on your infrastructure. For example, if your running your checks using the NSClient++, you may save the script as <code>C:Program FilesNSClient++scriptscheck_win_updates.wsf</code> and then add something like that to your <code>C:Program FilesNSClient++nsclient.ini</code>:
<pre> [/settings/default] timeout = 90
[/settings/external scripts/wrappings] wsf=cscript.exe //T:90 //NoLogo scripts%SCRIPT% %ARGS%
[/settings/external scripts/wrapped scripts] check_updates = check_win_updates.wsf </pre>
The timeout of 90 seconds is primarily for Windows 7 systems, which actually need a lot of time to search through installed updates... Also make sure that your call of the nrpe tool at the monitoring server waits long enough for the answer! (<code>.../check_nrpe3 [...] -t 90 [...]</code>)
To properly parse the details about pending updates, you may also need to add
<pre> [/settings/external scripts/scripts/default] ignore perfdata = true </pre>
This line tells the NSClient++ to not interprete the update details as performance data, and instead just forwards the details.
You must be logged in to submit a review.
To:
From: