How can I get the system's cpu Load Average by c.
How can I get the information of cpu load average by any way.
Use 'top' can see the information on top. But ,how can I get it or make it use programming. How dose the value of cpu load average make? Can you help me ? Thanks ! |
uptime
It's probably in /proc somewhere. |
you may try
Code:
::note:it may not work on your machine |
how can I get the remote computer's load average?
Thank you very much ,alred.
If I want to know the remote computer's load average. How can I do ? |
Copy your program to the remote computer and
run it there? Cheers, Tink |
I am sorry , I mean , the program has to run in my computer and I want to get the remote computer's load average.
I can not log on the remote computer, I can just visit it . I know it's IP and I have been got the information of it's MIB. How can i do ? |
just a random possibility , at last resort you may try
netcat look at the examples scripts then might be able to execute netcat script through coding for a more serious ones , you may try looking for snmp socket libraries at freashmeat or sourceforge |
http://www.securityfocus.com/tools/137
Is netcat's official home ... And that said: to make any use of netcat in that scenario you'd still need some sort of server- process on the remote machine that will output info on an arbitrary port that nc can listen on. Cheers, Tink |
does killing child processes reduce CPU load average??
Hi,
am using a program that forks child processes to increase CPU load.this seems to work,but when I try killing the child processes the load doesnot seem to decrease.Does killing child processes decrease CPU load average????? regards, expeliarmus |
Quote:
your applications are: - CPU bound or - I/O bound or - synchronizing with each other is some way In other words: where is the bottleneck? Is it CPU or I/O or latency time because the processes wait for each other (or even deadlock). Without a clear understanding of these questions you cannot meaningfully discuss your question. |
You could also make a php webpage with the load information. But you must be allowed to run external programs from php scripts:
<? echo exec('cat /proc/loadavg'); // or echo exec('uptime'); ?> |
Also you have a try to use a monitor application.
like zabbix(www.zabbix.com): when the client is running on a remotely machine, you can use the following command to get when exactly you want, e.g. : # the avarage CPU load bin/get -s IP_HERE -p10051 -k system.cpu[load1] # the avaliable partition volume for '/' bin/get -s IP_HERE -p10051 -k vfs.fs.size[/,free] #the inbound transfer bin/get -s IP_HERE -p10051 -k net.if.in[eth0] |
thanks a lot guys!!
|
All times are GMT -5. The time now is 04:49 PM. |