Es gab da mal einen CT article um sowas in nagios zu integriern.
Bin mir aber sicher das man das script dort relativ leicht abändern
kann um den output per blat zu verschicken.
Allerdings bleibt dir ohne powershell oder perl wohl nur die umständliche vbs variante.
' =========================================================
' Script to check for updates onwwindows machines.
' Shamelessly stolen from Micha³ Jankowski (fooky@pjwstk.edu.pl) script.
' =========================================================
' Required Variables
Const PROGNAME = "check_updates"
Const VERSION = "0.0.1"
' Default settings for your script.
threshold_warning = 10
threshold_critical = 5
' Create the NagiosPlugin object
Set np = New NagiosPlugin
' Define what args that should be used
np.add_arg "warning", "warning threshold", 0
np.add_arg "critical", "critical threshold", 0
' If we have no args or arglist contains /help or not all of the required arguments are fulfilled show the usage output,.
If Args.Exists("help") Then
np.Usage
End If
' If we define /warning /critical on commandline it should override the script default.
If Args.Exists("warning") Then threshold_warning = Args("warning")
If Args.Exists("critical") Then threshold_critical = Args("critical")
np.set_thresholds threshold_warning, threshold_critical
Set objAutoUpdate = CreateObject("Microsoft.Update.AutoUpdate")
intResultDetect = objAutoUpdate.DetectNow
If intResultDetect <> 0 Then: np.nagios_exit "UNKNOWN: Unable to detect Automatic Updates.", UNKNOWN
Set objSession = CreateObject("Microsoft.Update.Session")
Set objSearcher = objSession.CreateUpdateSearcher
intUncompleted = 0
intUncompletedSoftware = 0
Set objSysInfo = CreateObject("Microsoft.Update.SystemInfo")
If objSysInfo.RebootRequired Then: np.nagios_exit "WARNING: Reboot required.", WARNING
Set result = objSearcher.Search("IsInstalled = 0 and IsHidden = 0")
Set colDownloads = result.Updates
For i = 0 to colDownloads.Count - 1
If colDownloads.Item(i).AutoSelectOnWebsites Then
updatesNames = colDownloads.Item(i).Title & "+ " & updatesNames
intUncompleted = intUncompleted + 1
Else
intUncompletedSoftware = intUncompletedSoftware + 1
End If
Next
return_code = OK
If intUncompleted > 0 Then
return_code = np.check_threshold(intUncompleted)
np.nagios_exit "Number of critical updates not installed: " & intUncompleted & " Number of software updates not installed: " & intUncompletedSoftware, return_code
Else
np.nagios_exit "There is no critical update. Number of software or driver updates not installed: " & intUncompletedSoftware, OK
End If