[ZBX-22964] WMI Error 0x80041032 caused by Zabbix Agent 5.0 LTS for Windows Created: 2023 Jun 14  Updated: 2024 Feb 28  Resolved: 2024 Feb 13

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Agent (G)
Affects Version/s: 5.0.35
Fix Version/s: None

Type: Incident report Priority: Trivial
Reporter: Alexey Assignee: Bartosz Mickiewicz (Inactive)
Resolution: Duplicate Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows Server 2012 R2 with all updates installed.
Item from Template Module Windows CPU by Zabbix agent: Number of cores
wmi.get[root/cimv2,"Select NumberOfLogicalProcessors from Win32_ComputerSystem"]


Attachments: PNG File image-2023-07-12-14-14-45-552.png    
Issue Links:
Duplicate
duplicates ZBX-18859 wmi.get commands cause event 5858 Closed

 Description   

Hello!

Open Windows Event Viewer -> Applications and Services Logs -> Microsoft -> Windows -> WMI-Activity - Operational

There'll be lots of records of the same error:
Id = {03303A7A-437B-0015-5E97-31037B43D901}; ClientMachine = RMADM33; User = NT AUTHORITY\SYSTEM; ClientProcessId = 73052; Component = Unknown; Operation = Start IWbemServices::ExecQuery - root\cimv2 : Select NumberOfLogicalProcessors from Win32_ComputerSystem; ResultCode = 0x80041032; PossibleCause = Unknown

According to Microsoft's knowledge base:

The WMI client application should be modified to issue calls to IEnumWbemClassObject::Next to retrieve the full result set, before releasing the IWbemContext object. If no objects are received, make sure that the timeout value (lTimeout) is greater than 0 and that WBEM_S_TIMEDOUT (0x40004) is not being returned.

https://learn.microsoft.com/en-us/troubleshoot/windows-client/system-management-components/wmi-activity-event-5858-logged-with-resultcode-{*}0x80041032{*}

 



 Comments   
Comment by Alexey [ 2023 Jun 14 ]

Jira's not-quite-wysiwyg messed up the URL:
https://learn.microsoft.com/en-us/troubleshoot/windows-client/system-management-components/wmi-activity-event-5858-logged-with-resultcode-0x80041032

Comment by Bartosz Mickiewicz (Inactive) [ 2023 Jul 10 ]
This error can happen if the WMI application calls IEnumWbemClassObject::Next with a timeout value (lTimeout) that is not long enough to retrieve the object being queried.

Did you try to change your timeout on the agent and server/proxy? 
You can also test how long it takes for that query to return all the information using this Powershell command

Get-WmiObject -query "Select NumberOfLogicalProcessors from Win32_ComputerSystem" 

But in general, this is not a bug, a call executed by the agent reaches the timeout value. 

Comment by Alexey [ 2023 Jul 11 ]

 You can also test how long it takes for that query to return all the information using this Powershell command

 

Measure-Command { Get-WmiObject -query "Select NumberOfLogicalProcessors from Win32_ComputerSystem" }
Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 0
Milliseconds      : 19
Ticks             : 199969
TotalDays         : 2.31445601851852E-07
TotalHours        : 5.55469444444444E-06
TotalMinutes      : 0.000333281666666667
TotalSeconds      : 0.0199969
TotalMilliseconds : 19.9969

 

PS C:\Program Files\Zabbix Agent> Measure-Command { .\zabbix_agentd.exe -t "wmi.get[root/cimv2,Select NumberOfLogicalPro
cessors from Win32_ComputerSystem]" }

Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 3
Milliseconds      : 19
Ticks             : 30198104
TotalDays         : 3.49515092592593E-05
TotalHours        : 0.000838836222222222
TotalMinutes      : 0.0503301733333333
TotalSeconds      : 3.0198104
TotalMilliseconds : 3019.8104

Great idea, I'll try to increase Zabbix timeout.

It's kinda slow tho.

 

 

Comment by Alexey [ 2023 Jul 12 ]

Increasing timeouts didn't help.

Please note this from previous message: 
TotalMilliseconds : 19.9969
TotalMilliseconds : 3019.8104
Agent is literally working wery slow.

But that is not the problem.

I've done a couple of the same measurements on another Windows machines.

The same result with WMI error logging, just faster in terms of total execution time.

This is from my PC, Windows 10 22H2

Comment by Bartosz Mickiewicz (Inactive) [ 2023 Nov 16 ]

Well, the agent actually collected the value, if you see the agent reported back 8 logical processors. Can you try agent2?

Comment by Mihails Prihodko [ 2024 Feb 13 ]

Fixed in and closed as duplicate of ZBX-18859.

akholodov, thank you for a good description. Especially for the link to the Microsoft documentation https://learn.microsoft.com/en-us/troubleshoot/windows-client/system-management-components/wmi-activity-event-5858-logged-with-resultcode-0x80041032

Generated at Sat Apr 26 05:13:40 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.