473,327 Members | 2,118 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

i want to get memory usage of client through IP address.

18
hi all;

i am new in .NET and i am assigned work like this.

my question is that, 3 clients are connected wtih server on LAN, i want to get the cpu usage and physical memory usage of one client on another client,
i more specify my questin that, i have IP address 10.15.24.10 and the IP of my friend is 10.15.24.30, from my system i just pass IP Address of my friend's system and i get cpu usage and physical memory usage of my friend.

please tell me is it possible by using any method ?? and please also demonstrate in little detail what process should i follow, this problem will be solved by using desktop application or web based app.

please............... give me idea about its development.

regards
Sep 18 '08 #1
11 10854
PRR
750 Expert 512MB
take a look at this thread:
thread

For remote computers you need to supply username and password along with IP/computername

Expand|Select|Wrap|Line Numbers
  1. ConnectionOptions con = new ConnectionOptions();
  2.  
  3.             con.Username = "";
  4.             con.Password = "";
  5.  
  6.             ManagementScope scope = new ManagementScope(
  7.             "\\\\ComputerName\\root\\cimv2", con);
  8.             scope.Connect();
  9.  
  10.             ObjectQuery que = new ObjectQuery(
  11.             "SELECT * FROM Win32_OperatingSystem");
  12.  
  13.             ManagementObjectSearcher searcher = 
  14.             new ManagementObjectSearcher(scope,que);
  15.  
  16.  
  17.             ManagementObjectCollection querys = searcher.Get();
  18.  
  19.             foreach (ManagementObject m in querys)
  20.  
  21.             {
  22.                 string s = Convert.ToString(m["FreePhysicalMemory"]).Trim();
  23.                 s = Convert.ToString(m["FreeVirtualMemory"]).Trim();
  24.                 s = Convert.ToString(m["TotalVirtualMemorySize"]).Trim();
  25.                 s = Convert.ToString(m["TotalVisibleMemorySize"]).Trim();
  26.  
  27.             }
  28.  
  29.  
  30.  
Sep 18 '08 #2
PRR
750 Expert 512MB
Do add a reference to System.Management;

For more info google : WMI (windows management instrumentation)
Also look for a wmi tool in msdn...
Sep 18 '08 #3
balach
18
thanks alot ''Dirtbag" for answer but, when i give the IP address(10.15.24.30) of my friend's computer in "management scope" as like in code below to check my friend's memory usage at that specific time, then it gives error that" RPC server is not connected or not responding" i think that it is an exception that is fired, and i am unaware to handle this exception to fulfil my requirement that is named as the title of this thread.

i shall be thankful if you could resolve this problem, or any other forum member who could help me.

Expand|Select|Wrap|Line Numbers
  1.  
  2. ConnectionOptions con = new ConnectionOptions(); 
  3. con.Username = ""; 
  4. con.Password = ""; 
  5.  
  6. ManagementScope scope = new ManagementScope( "\\\\10.15.24.30\\root\\cimv2", con); 
  7.  
  8. //Here comes error on executing below line, that RPC server is not responding
  9.  
  10. scope.Connect(); 
regards
Sep 26 '08 #4
Plater
7,872 Expert 4TB
when i give the IP address(10.15.24.30) of my friend's computer in "management scope" as like in code below to check my friend's memory usage at that specific time, then it gives error that" RPC server is not connected or not responding"
WMI calls are blocked by firewalls in general (security), so if your friend is on another network, or is otherwise blocked by a firewall, you will not be able to make the connection. You also need to be able to supply valid user credentials to get into the system, and the user must have rights to use WMI on the system.

I would look up the WMICodeCreator tool, it's pretty helpfull in building WMI calls (it will write code for you)
Sep 26 '08 #5
jg007
283 100+
you will need to also have admin access the other PC and access to the RPC share and , to check if you have access try connecting to the other computer using computer managment and see it that works

( right click 'my computer' , select manager , click on 'action ' then connect to another computer .

also it is not something that is easy to do using XP home and really needs you to have XP Pro so that you can set up the permissions okay

also look at hamatchi if your friends pc is not on the same network as you.
Sep 26 '08 #6
balach
18
thanks for answers, but unfortunately problem is still there, i have checked all of the scenarios delivered by "jg007" and "plater" with this additional scenario, as given at this url

Even this url has also not solved my problem

my program is still giving this error "The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)"
this error is generated on this line of code
scope.Connect();

i request for some other possible issues that i must check regarding this problem.
Sep 27 '08 #7
jg007
283 100+
please can you advise what happens when you try to connect using computer manager and also if you are able to connect to the other pc by accessing the c$ share on it

to access C$ share go to run and enter below replacing the ip add bit with whatever the remote machine is-

\\<IP ADDRESS>\c$
Sep 27 '08 #8
Plater
7,872 Expert 4TB
I would guess that one or BOTH of you have the RPC services turned off then?
There is
Remote Procedure Call (RPC)
and
Remote Procedure Call (RPC) Locator
services, which i think need to be running.

You should try to connect using the windows manager thing mentioned earlier and see what happens
Sep 29 '08 #9
PRR
750 Expert 512MB
check this out
MSDN
See This too
see

As Plater pointed out u need..(especially if u are startin or stoppin services)

"Remote Procedure Call (RPC)
and
Remote Procedure Call (RPC) Locator
services, which i think need to be running."


ConnectionOptions con = new ConnectionOptions();
con.Username = ""; // You need to provide administrator name
con.Password = ""; // and password... cant be blank for remote PC..
Without proper username n password u wont be able to connect( also the username should have admin or wmi rights on the remote PC)...
Although WMI calls are blocked by default .... for querying information that should not be a problem...if i remember correctly i had issues tryin to shutdown remote pc... gettin remote information was OK as long as windows firewall was off...
Sep 29 '08 #10
balach
18
thank you very much to all, giving me best possible cases for accessing remote system's information, but i do not wnat to do any configuration on remote system, as mentioned in the last post, sent by "DeepBlue".

here, what i desire, without doing any configuration on remote system, by using any method of c#.NET, how do i get remote System information as like CPU usage, Memory Usage of remote system.


thanks in advace for answers and coding.
GOD BLESS ALL OF YOU
Oct 11 '08 #11
jg007
283 100+
if you do not have permission to access the RPC on the other system you wil NOT be able to find out this information.

please confirm what happens when you try as above to connect to the c$ share or computer manager as this will diagnose further to see if it is just your program or if you do not have the access that you need to do what you want to do
Oct 11 '08 #12

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: David Swift | last post by:
Hello. I'm new to the news group and new to IIS. I'm trying to help a client deal with memory usage issues in IIS. My client is running IIS 5.0 on a Win2K box and is running ASP scripts that...
4
by: Frank Esser | last post by:
I am using SQL 8 Personal edition with sp2 applied. I set the max server memory to 32MB and leave the min server memory at 0. When my application starts hitting the database hard the memory usage...
9
by: Jimmy Cerra | last post by:
I am a little confused how the memory for objects is allocated in JavaScript. David Flanagan, in "JavaScript: The Definitive Guide," states that each property of a class takes up memory space when...
7
by: Jon Trickey | last post by:
We migrated to 8.1 from 7.2 this weekend. Everything ran ok over the weekend, but we have a light user load then (about 200 users.) Today when we had close to 600 users connecting and running...
8
by: Grant Richard | last post by:
Using the TcpListener and TcpClient I created a program that just sends and receives a short string - over and over again. The program is fine until it gets to around 1500 to 1800 messages. At...
2
by: gavino | last post by:
REHDAT LINUX 4S PHP 4.3.9 LEGACY APP I MOVED NOW EATS MEMORY CAN ANYONE TAE A LOOK ? I FIXED ONE PARTIALLY BY CHANGING TO here are my apache settings: 1 page laoding for a few seconds eat like...
4
by: =?Utf-8?B?U2FuZGVlcCBUaG9wcGls?= | last post by:
Hi We built a Windows application on .Net 2 framework using Infragistics controls. We got a bug reported from our client complaining high physical memory consumption showing in the task manager...
2
by: jld | last post by:
Hi, I developed an asp.net based eCommerce Website for a client and it is hosted at discount asp. The site is quite interactive, queries a database a lot and uses ajax.asp.net to spice up...
22
by: Peter | last post by:
I am using VS2008. I have a Windows Service application which creates Crystal Reports. This is a multi theaded application which can run several reports at one time. My problem - there is a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.