> I'm writing a script that will collect information about a
> server. It is really easy to get the number of processors
> either through the ENV array or through Win32::Systeminfo.
> But with hyper-threading of course you get double the number
> of processors. Being that we have old server without
> hyper-threading and new servers with I can't just assume one
> or the other. Has anyone figured how to tell if the server
> has it or not via a script?
The following is taken from a script I have to check an OU for
hyperthreading. It relies on the resourcekit utility htdump.exe, and
SysInternals' excellent psexec, since htdump won't run remotely. As you
can see, it's just a matter of parsing the output.
Paul
my $hostname = $a->{dNSHostName};
unless (-f "\\\\$hostname\\admin\$\\htdump.exe") {
unless
(copy("\\\\dpfm.net\\dpfmroot\\sysadmin\\tools\\htdump.exe",
"\\\\$hostname\\admin\$")) {
print swrite($format, $hostname, "Can't copy -
admin rights?");
return undef;
}
}
my $cmd = "psexec \\\\$hostname cmd /c
%SystemRoot%\\htdump.exe";
my $ht = `$cmd`;
my $htenable = ($ht =~ /Processors are hyp/) ? "hyperthreading
enabled" : "hyperthreading disabled";
*****************************************************************
Gloucester Research Limited believes the information
provided herein is reliable. While every care has been
taken to ensure accuracy, the information is furnished
to the recipients with no warranty as to the completeness
and accuracy of its contents and on condition that any
errors or omissions shall not be made the basis for any
claim, demand or cause for action.
*****************************************************************
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs