
Check remote computer's memory resource
That's a two-part question. The first is easy enough, determining memory
usage on a machine:
Private Type MEMORYSTATUS
dwLength As Long
dwMemoryLoad As Long
dwTotalPhys As Long
dwAvailPhys As Long
dwTotalPageFile As Long
dwAvailPageFile As Long
dwTotalVirtual As Long
dwAvailVirtual As Long
End Type
Private Declare Sub GlobalMemoryStatus Lib "Kernel32" _
(lpBuffer As MEMORYSTATUS)
Public Function GetAvailableMemory() As Long
Dim ms As MEMORYSTATUS
GlobalMemoryStatus ms
GetAvailableMemory = ms.dwAvailPhys
End Function
The second, getting those values back to a central location, has multiple
answers. One way would be to have a shared database with a table where every
machine has its own record, which it could update every 30 seconds or
somesuch. But if your machines are scattered around the country, that may
not be practical.
A low-tech approach would be to have each machine email the results to the
mother ship.
Another more involved approach, if your machines are running TCP/IP, would
be to use the Winsock control to open a network communication channel
between the machine. They could then send periodic results that way. Correct
socket programming is a little trickier than people first think, so I'd
suggest reading around if you want to go that route. A couple of places to
start would be the online help (naturally), the MSDN web site, and
http://www.vbip.com.
Quote:
> Hi...
> I am working at a company, and was asked to create a program to monitor
the
> memory status of several servers across the country.
> I am developing it using VB. My question is, how do can I get information
> about the memory usage, availability and such on the server side, from my
> workstation.
> Any help would be great. Thanks in advance.
> Thorrel