short thoughts‎ > ‎

count the number of processors (CPU) on windows with nsclient++

posted Mar 8, 2011, 3:46 PM by Steve Craig
There are many reasons to count the number of actual processor cores on a windows machine - licensing foremost among them!

Happily, the information is very easy to obtain remotely, as long as you have nsclient++ setup and installed on the target host.  I'll skip over that part of this and assume you already have that done.  Chances are good if you are running nagios as your monitoring system this has been taken care of.

Here is the command syntax to check the number of processors via check_nrpe and the nsclient++ daemon:

-bash-3.2$ ./libexec/check_nrpe -H -c CheckWMIValue -a "Query=Select * from Win32_ComputerSystem" Check:NUMCPUS=NumberOfProcessors
OK: Everything seems fine.|'NUMCPUS'=2;0;0;

In this case, my system had two physical processors.