View Full Version : CPU count
ReefShark
27-01-2006, 15:21
My manager wants me to 'monitor' the number of CPU's in every system. I think I can write something for linux to extract that data from the system, but I am somewhat Windoze-challenged and have no idea how to pull it off on the W2K servers I put in Zabbix.
Any help on this matter would be greatly appreciated. :o
If you mean the amount of processes running, than there are built-in functions for that.
If you read the following registry key and count the subkeys, you get the number of CPUs.
HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\Cen tralProcessor
The 0, 1, 2, 3...etc. represent the different processors. Now, without checking, this may represent the number of processors that the OS sees - not the physical number (ie. dual-core or hyperthreading may show different numbers). However, I am certain that if you check the Net, you can find a method to determine if the processor listed are physical or virtual.
Reading the registry can be done easily with VBScript via WSH, WinBatch...
cameronsto
28-01-2006, 00:37
This can also be achieved via WMI and VBS. Here's an example, http://vbnet.mvps.org/index.html?code/wmi/win32_processor.htm
-cameron
ReefShark
01-02-2006, 09:26
Got the linux clients working with
UserParameter=system.cpucount,grep processor /proc/cpuinfo | wc -l
Still looking into the Windows stuff.... Is there any way to get the number of CPU's present through SNMP?
On Windows clients use the key in a host item
system.cpu.num[online]
Description - Processor Count
Type - Zabbix Agent
Key - system.cpu.num[online]
Type of information - Numeric (Integer 64bit)
Units -
Use multiplier - Do Not Use
Update interval (in sec) - 3600
nelsonab
04-08-2009, 19:11
Got the linux clients working with
UserParameter=system.cpucount,grep processor /proc/cpuinfo | wc -lStill looking into the Windows stuff.... Is there any way to get the number of CPU's present through SNMP?
As someone mentioned earlier that will give you the total number of cores, not physical CPU's
As someone mentioned earlier that will give you the total number of cores, not physical CPU's
And for cores with hyperthreading enabled, each core is counted twice. New Intel CPUs (i7) are multicore AND hyperthreaded ;)
Hope this helps
Alixen