[ZBX-18663] Template "Windows CPU by Zabbix agent", does not recognize the number of CPUs. Created: 2020 Nov 16  Updated: 2020 Nov 20

Status: Confirmed
Project: ZABBIX BUGS AND ISSUES
Component/s: Templates (T)
Affects Version/s: 5.2.0
Fix Version/s: None

Type: Incident report Priority: Trivial
Reporter: Stefan Sabolowitsch Assignee: Zabbix Development Team
Resolution: Unresolved Votes: 0
Labels: templates
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows Server 2019


Attachments: PNG File Core_CPU.png     PNG File cpus-1.PNG     PNG File cpus.PNG     PNG File image-2020-11-17-10-27-55-459.png     PNG File image-2020-11-19-15-21-21-626.png    

 Description   

Hi there,
In Zabbix v5.2 original template "Windows CPU by Zabbix agent", the number of CPU cores is not recognized or incorrectly reported back.

The error message:

Value of type "string" is not suitable for value type "Numeric (unsigned)"

The correct value is returned with powershell

wmic CPU get NumberOfCores,NumberOfLogicalProcessors
NumberOfCores  NumberOfLogicalProcessors
6              12


 Comments   
Comment by Aleksandrs Pahomovs [ 2020 Nov 19 ]

Hello,

Original template query is like "wmic cpu get NumberOfLogicalProcessors" and answer is 12 for you.

Cannot be reproduced with 5.2.0 and Win Server 2019.

Comment by Stefan Sabolowitsch [ 2020 Nov 19 ]

Hi, maybe it's because of the agent we use v2

Comment by Stefan Sabolowitsch [ 2020 Nov 19 ]

Found the Bug !

wmi select ist wrong:

wmi.get[root/cimv2,"Select NumberOfLogicalProcessors from Win32_ComputerSystem"]

correct without quotation marks!

wmi.get[root/cimv2, Select NumberOfLogicalProcessors from Win32_ComputerSystem]

i get now without quotation marks the correct value:

C:\Program Files\Zabbix Agent 2>zabbix_agent2.exe -t "wmi.getall[root/cimv2, Select NumberOfLogicalProcessors from Win32_ComputerSystem]"
wmi.getall[root/cimv2, Select NumberOfLogicalProcessors from Win32_ComputerSystem][s|[{"Name":"SFG05","NumberOfLogicalProcessors":12}]]
Comment by Stefan Sabolowitsch [ 2020 Nov 19 ]

@Aleksandrs Pahomovs

OK, It's a little strange
now i get no value return

C:\Program Files\Zabbix Agent 2>zabbix_agent2.exe -t "wmi.get[root/cimv2, Select NumberOfLogicalProcessors from Win32_ComputerSystem]"
wmi.get[root/cimv2, Select NumberOfLogicalProcessors from Win32_ComputerSystem][s|SFG05]

What's going on here ?

Comment by Stefan Sabolowitsch [ 2020 Nov 20 ]

Basically there are two bugs, one is the template with the wrong WIMI Select and agent2 that it cannot (always) read the value.

Generated at Sat Apr 26 04:06:28 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.