Build precise queries to find exactly what you need
Press ESC to close
Your review has been submitted and is pending approval.
Plugin calculates number of days since last success update.
Current Version
0.2
Last Release Date
2015-04-03
Owner
Bratislav Stojkovic
License
GPL
Compatible With
Plugin calculates number of days since last success update using "LastSuccessTime" Windows registry key.The same date you can find in Windiows updates log. Plugin is tested with NSClient++ v 0.4, NSCP-0.4.x. strKeyPath = "SOFTWAREMicrosoftWindowsCurrentVersionWindowsUpdateAuto UpdateResultsInstall" strEntryName = "LastSuccessTime" (Value Data).
Usage: cscript check_win_lastupdate.vbs /w:90 /c:120
Script is working on localhost, so you should use for example NRPE and add this line in nsclient.ini in section [/settings/external scripts/scripts]
check_win_lastupdate=cscript.exe //T:30 //NoLogo scripts/check_win_lastupdate.vbs /w:$ARG1$ /c:$ARG2$
Hi Guys, there is an Error in your Script. If you set the warning ord critical date to for example 30 and 60 Days, the script will work until the days since last update is excactly 30 or 60 days. 31 or 61 or 29 or 59 will work. You have to modify your if and elseif at the end to = insted of See here the edited code snipped: If DD >= updateTresholdCritical Then Wscript.Echo "CRITICAL: Patches are not applied for the last " & DD & " days." Wscript.Quit(intCritical) ElseIf DD >= updateTresholdWarning Then Wscript.Echo "WARNING: Patches are not applied for the last " & DD & " days." Wscript.Quit(intWarning) ElseIf DD =
This script works like a charm. As promised it is very fast and solely takes a registry value instead of having windows search for updates (which almost always leads to a timeout). There is only little glitch though: When Windows was NEVER updated, the script will return an error stating that "CDate" cannot be created with a NULL value. I fixed it by editing the script thusly (maybe if someone has a more reliable check for NULL, please feel free to add a it): [Snippet starts at line 26 of check_win_lastupdate.vbs] ---------------------- strComputer & "rootdefault:StdRegProv") objReg.GetStringValue HKEY_LOCAL_COMPUTER, strKeyPath, strEntryName, strValue '----------------------------------- if IsNull(strValue) = -1 then Wscript.Echo "CRITICAL: Patches have NEVER been applied!" Wscript.Quit(intCritical) end if '----------------------------------- InstallDate = CDate(strValue) CurrentDate = CDate(Now) [...] ---------------------------------------------- Thanks for the script :)
You must be logged in to submit a review.
To:
From: