Missing monitoring data for plugins, windows_updates

CMK version: 2.3.0p27raw
Client OS version: Windows Server 2022 Datacenter 21H2 Buildnumber: 20348.3091

Error message:

Hello everyone,

On our new Windows Servers 2022 the windows_update.vbs is running into a timeout (no output given in 60 seconds)

image

I have tested the script locally via a admin cmd:

image

I have waited 30 minutes but the vbs script is stuck :thinking:

How can I debug this script?

Here is the windows_update.vbs I am using:
windows_updates.vbs (3.7 KB)

I have identified the problematic line in the vbs script:

Set result = updtSearcher.Search("IsInstalled = 0 and IsHidden = 0")
objStdout.WriteLine "<<< debug-message!!! >>>"

My debug message is not displayed

WMI timeouts are a known issue on Windows, and they are not always trivial to understand (as they sometimes occur entirely randomly). You can try to increase the WMI timout for the agent, so plugins have a little more time to query WMI. And you could double-check if the Windows Update Agent is actually healthy on the Windows host, or if there is an issue with that component of Windows.

This problem is not a

it means normally that the Windows update settings are not correct and the update searcher cannot find any updates in a reasonable time.
The update script itself uses the “Microsoft.Update.Session” ComObject and executes then only the UpdateSearcher.Search.

I would first check if this server had some update installed in the last weeks/months. If updates are provided with something else than WSUS or direct internet access then it is normal that the UpdateSearcher doesn’t find anything.
Update install check

$Searcher = (New-Object -ComObject Microsoft.Update.Session).CreateUpdateSearcher()
$HistoryCount = $Searcher.GetTotalHistoryCount()
if ($HistoryCount -eq 0) {
    exit 0
}
$Searcher.QueryHistory(0, $HistoryCount) `
| Where-Object { $_.title -ne $null } `
| Sort-Object date -desc `
| Select-Object -First 10

This gives you the last 10 updates installed. The output must be instant.
If you get nothing then no updates where installed on this machine after setup.

1 Like

I have found the problem. We are blocking many services from Microsoft and that is the cause for the timeouts. I now run this script asynchrone (onece a day) and that solves my problem