-----Original Message-----
From: RICH, ADAM (SBCSI) [mailto:[EMAIL PROTECTED]
Sent: Friday, July 11, 2003 6:31 PM
To: 'Messenger, Mark'; '[EMAIL PROTECTED]'; [EMAIL PROTECTED]
Subject: RE: Win32::AdminMisc::GetMemoryInfo reporting unrealistic dataThe AdminMisc function probably uses the GlobalMemoryStatus() Win32 API call,which stores memory values as bytes in a 32-bit integer. Unfortunately, any values4 GB or greater will overflow this value. The GlobalMemoryStatusEx() functionshould be used instead, but I'm not aware of any perl modules that use it. For myown use, I wrote a small exe in C which reports the size correctly usingGlobalMemoryStatusEx() and I just system() that from perl.I don't think the registry routine below works either, on my machine it reports 16 MBwhen I actually have 512.-----Original Message-----
From: Messenger, Mark [mailto:[EMAIL PROTECTED]
Sent: Friday, July 11, 2003 5:18 PM
To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED]
Subject: RE: Win32::AdminMisc::GetMemoryInfo reporting unrealistic dataYou 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: 1393Uh.... 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
Title: RE: Win32::AdminMisc::GetMemoryInfo reporting unrealistic data
I
don't suppose you have a Win32::OLE way to call GlobalMemoryStatusEx()?
:)
- Win32::AdminMisc::GetMemoryInfo reporting unrealistic ... lgbarr
- Re: Win32::AdminMisc::GetMemoryInfo reporting unr... Patrick J. LoPresti
- RE: Win32::AdminMisc::GetMemoryInfo reporting unr... Messenger, Mark
- RE: Win32::AdminMisc::GetMemoryInfo reporting unr... RICH, ADAM (SBCSI)
- RE: Win32::AdminMisc::GetMemoryInfo reporting unr... Messenger, Mark
- RE: Win32::AdminMisc::GetMemoryInfo reporting unr... Messenger, Mark
- Re: Win32::AdminMisc::GetMemoryInfo reporting... Patrick J. LoPresti
- RE: Win32::AdminMisc::GetMemoryInfo reporting unr... RICH, ADAM (SBCSI)
- RE: Win32::AdminMisc::GetMemoryInfo reporting unr... Messenger, Mark
- RE: Win32::AdminMisc::GetMemoryInfo reporting unr... Dave Roth
- RE: Win32::AdminMisc::GetMemoryInfo reporting unr... Dave Roth
- RE: Win32::AdminMisc::GetMemoryInfo reporting unr... lgbarr
- RE: Win32::AdminMisc::GetMemoryInfo reporting unr... lgbarr
- RE: Win32::AdminMisc::GetMemoryInfo reporting unr... Dave Roth
