You could use Win32::TieRegistry, for testing...
use Win32::TieRegistry( Delimiter=>"\\", ArrayValues=>0 );
$machine="\\\\COMPUTERNAMEGOESHERE"; # leave all 4 slashes, please.
$regstr="$machine\\HKEY_LOCAL_MACHINE\\HARDWARE\\RESOURCEMAP\\System Resources\\Physical Memory\\";
$regobj=$Registry->{$regstr};
$memstr=$regobj->Win32::TieRegistry::GetValue("\.Translated");
$last=unpack(C,substr($memstr,(length($memstr)-1),1));
$memtot=(16*($last+1));
print "Mem on $machin = $memtot Megs\n";
Try that one on for size and see what it reports...
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 11, 2003 11:59 AM
To: [EMAIL PROTECTED]
Subject: Win32::AdminMisc::GetMemoryInfo reporting unrealistic data
Hi all,
I've got a Dell server on hands and a Perl app which reports on the
status of certain servers on my network.
the following is the perl script:
use Win32::AdminMisc;
%Mem = Win32::AdminMisc::GetMemoryInfo();
%Processor = Win32::AdminMisc::GetProcessorInfo();
foreach (sort keys %Mem) {
print "$_: $Mem{$_}\n";
}
foreach (sort keys %Processor) {
print "$_: $Processor{$_}\n";
}
And this is what it reports:
Load: 80
PageAvail: 1701429248
PageTotal: -1
RAMAvail: 1603432448
RAMTotal: 2147483647
VirtAvail: 2115244032
VirtTotal: 2147352576
MMX: 1
OEMID: 0
PageSize: 4096
ProcessorLevel: 15
ProcessorNum: 8
ProcessorRevision: 257
ProcessorSpeed: 1932
ProcessorType: 586
Win32ProcessorSpeed: 1393
Uh.... Well... Most of the data reported is correct, except for RAMTotal.
Its being reported as a 2GB server, while in fact it is a server with 8GB
of RAM.
This might have been reported before. So I hope someone might help me out
on this.
Also, the Perl -v reports as 5.6.1, build 630.
Any info would be greatly appreciated..
Thanks,
/LG
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
