ohh thanks.. 
can i give the script parameters?
ala
and i got only this Data?
---------------------------------------
now you dont need to setup the hostname manualy..


can i give the script parameters?
ala
Code:
updates.whs -updatesHigh
---------------------------------------
now you dont need to setup the hostname manualy..

Code:
serverName = "zabbix.mydoamin.com"
hostName = strComputerName
zbxSender = "C:\Program Files\Zabbix Agent\zabbix_sender.exe"
updatesHigh = 0
updatesOptional = 0
Set objSearcher = CreateObject("Microsoft.Update.Searcher")
Set objSysInfo = CreateObject("Microsoft.Update.SystemInfo")
Set objResults = objSearcher.Search("IsInstalled=0")
Set colUpdates = objResults.Updates
Set WSHShell = CreateObject("WScript.Shell")
Set wshNetwork = WScript.CreateObject( "WScript.Network" )
strComputerName = wshNetwork.ComputerName
For i = 0 to colUpdates.Count - 1
If (colUpdates.Item(i).IsInstalled = False AND colUpdates.Item(i).AutoSelectOnWebSites = False) Then
updatesOptional = updatesOptional + 1
ElseIf (colUpdates.Item(i).IsInstalled = False AND colUpdates.Item(i).AutoSelectOnWebSites = True) Then
updatesHigh = updatesHigh + 1
End IF
Next
updatesTotal = (updatesHigh + updatesOptional)
WSHShell.Exec zbxSender & " -z " & serverName & " -s " & hostName & " -k win_updates[total] -o " & updatesTotal
WSHShell.Exec zbxSender & " -z " & serverName & " -s " & hostName & " -k win_updates[high] -o " & updatesHigh
WSHShell.Exec zbxSender & " -z " & serverName & " -s " & hostName & " -k win_updates[optional] -o " & updatesOptional
WSHShell.Exec zbxSender & " -z " & serverName & " -s " & hostName & " -k win_updates[reboot] -o " & objSysInfo.RebootRequired
WScript.Quit 0

Comment