how do you find current cpu usage on machine?

2001-09-06 Thread Steve Wright

Hi,
I need to find the current cpu (& memory) usage on my machine, as a 
percentage, can anyone help ?

Steve.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Re: how do you find current cpu usage on machine?

2001-09-06 Thread Ilya Martynov


SW> Hi,
SW> I need to find the current cpu (& memory) usage on my machine, as a 
SW> percentage, can anyone help ?

top

-- 
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Ilya Martynov (http://martynov.org/)|
| GnuPG 1024D/323BDEE6 D7F7 561E 4C1D 8A15 8E80  E4AE BE1A 53EB 323B DEE6 |
| AGAVA Software Company (http://www.agava.com/)  |
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




current cpu usage

2001-09-06 Thread Steve Wright

Ilya,

sorry, I should have been more specific, I need to get the output in a format 
a script could use. 
I have tried the uptime command however I'm a bit lost at what the numbers 
displayed represent (& how to turn these into a percentage).
(If indeed this is a good way to do this)

Steve.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Re: current cpu usage

2001-09-06 Thread Peter Billson

> sorry, I should have been more specific, I need to get the output in a format
> a script could use.
> I have tried the uptime command however I'm a bit lost at what the numbers
> displayed represent (& how to turn these into a percentage).
> (If indeed this is a good way to do this)

/usr/bin/top -bin 1

Will run top with just the running processes listed then spit out the
output and exit. A perl script should be able to parse the output and do
the math. See man top for details.

Pete
-- 
http://www.elbnet.com
ELB Internet Services, Inc.
Web Design, Computer Consulting, Internet Hosting


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Re: current cpu usage

2001-09-06 Thread Felipe Alvarez Harnecker

Peter Billson writes:
 > > sorry, I should have been more specific, I need to get the output in a format
 > > a script could use.
 > > I have tried the uptime command however I'm a bit lost at what the numbers
 > > displayed represent (& how to turn these into a percentage).
 > > (If indeed this is a good way to do this)
 > 
 > /usr/bin/top -bin 1
 > 
 > Will run top with just the running processes listed then spit out the
 > output and exit. A perl script should be able to parse the output and do
 > the math. See man top for details.
 > 
 > Pete
 > -- 
 > http://www.elbnet.com
 > ELB Internet Services, Inc.
 > Web Design, Computer Consulting, Internet Hosting
 > 
 > 
 > -- 
 > To UNSUBSCRIBE, email to [EMAIL PROTECTED]
 > with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
 > 
 > 

I'm really not sure but cat /proc/smothing should do the trick

-- 
__

Felipe Alvarez Harnecker.  QlSoftware.

Tels. 665.99.41 - 09.874.60.17
e-mail: [EMAIL PROTECTED]

http://qlsoft.cl/
http://ql.cl/
__


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Re: current cpu usage

2001-09-06 Thread Robert Waldner


On Thu, 06 Sep 2001 09:00:37 EDT, Peter Billson writes:
>> sorry, I should have been more specific, I need to get the output in a forma
>t
>> a script could use.
>> I have tried the uptime command however I'm a bit lost at what the numbers
>> displayed represent (& how to turn these into a percentage).
>> (If indeed this is a good way to do this)
>
>/usr/bin/top -bin 1

cat /proc/meminfo
cat /proc/loadavg

hth+cheers,
&rw
-- 
/ Ing. Robert Waldner |  <[EMAIL PROTECTED]>  \
\ Xsoft GmbH  | T: +43 1 796 36 36 692 /



 PGP signature


cpu usage

2001-09-06 Thread Steve Wright

Thanks for that,
top -bin 1 seems to do the trick nicely, also found a bit of documentation at
http://faq.mrtg.org/linux/proc-load.html
that should let me do it without using top.

Cheers.
Steve.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Re: current cpu usage

2001-09-06 Thread Peter Billson

> cat /proc/meminfo
> cat /proc/loadavg

 The meminfo would help him but he posted that he didn't understand load
average and, anyway, needs percent of CPU used. You can not calculate
CPU usage from load average.

  You could use /proc to get CPU usage but it would be rather involved
to do and why bother when the nice man who wrote top has already done it
for you. :-)

Pete
-- 
http://www.elbnet.com
ELB Internet Services, Inc.
Web Design, Computer Consulting, Internet Hosting


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Re: current cpu usage

2001-09-06 Thread Robert Waldner


On Thu, 06 Sep 2001 09:34:05 EDT, Peter Billson writes:
>> cat /proc/meminfo
>> cat /proc/loadavg
>
> The meminfo would help him but he posted that he didn't understand load
>average and, anyway, needs percent of CPU used. You can not calculate
>CPU usage from load average.

Not to mention the deep dark magic by which loadavg is generated. I 
 still don´t understand that completely ;-)

And yep, that should´ve read 
 cat /proc/stat
instead. (And no, I don´t know what the values in the first line 
 exactly mean, but as soon as I set up mrtg again, I´m gonna read up on 
 the kernel-sources)

>  You could use /proc to get CPU usage but it would be rather involved
>to do and why bother when the nice man who wrote top has already done it
>for you. :-)

´cause it´s *fun* ;-)

cheers,
&rw
-- 
/ Ing. Robert Waldner |  <[EMAIL PROTECTED]>  \
\ Xsoft GmbH  | T: +43 1 796 36 36 692 /



 PGP signature


Starving Student Needs Help

2001-09-06 Thread Jackson Lim

Hi I am a Canadian University Student.  I was wondering, does anyone
know where I can get a cheap connection to the Internet in Canada.  I
can use the school's internet service but it is choppy and expensive
and to boot, waiting at the free kiosks are more trouble then it's
worth.  I can't use Bell's service because I can't afford it.  I need
the Internet to do school workHELP
 
Starving Student


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Re: current cpu usage

2001-09-06 Thread Andy Bastien

In the depths of that dark day Thu Sep 06, the words of Robert Waldner were the beacon:
> 
> On Thu, 06 Sep 2001 09:34:05 EDT, Peter Billson writes:
> >> cat /proc/meminfo
> >> cat /proc/loadavg
> >
> > The meminfo would help him but he posted that he didn't understand load
> >average and, anyway, needs percent of CPU used. You can not calculate
> >CPU usage from load average.
> 
> Not to mention the deep dark magic by which loadavg is generated. I 
>  still don´t understand that completely ;-)
> 

I thought that the kernel just counted the number of process ready to
run at a certain interval (I don't know what the interval is but I've
always assumed that its every second or couple of seconds) and then
just averaged those values over 1 min, 5 min and 15 min.  Is there
more to it than that?



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Re: current cpu usage

2001-09-06 Thread Nathan E Norman

On Thu, Sep 06, 2001 at 03:50:01PM +0200, Robert Waldner wrote:
> 
> On Thu, 06 Sep 2001 09:34:05 EDT, Peter Billson writes:
> >> cat /proc/meminfo
> >> cat /proc/loadavg
> >
> > The meminfo would help him but he posted that he didn't understand load
> >average and, anyway, needs percent of CPU used. You can not calculate
> >CPU usage from load average.
> 
> Not to mention the deep dark magic by which loadavg is generated. I 
>  still don´t understand that completely ;-)
> 
> And yep, that should´ve read 
>  cat /proc/stat
> instead. (And no, I don´t know what the values in the first line 
>  exactly mean, but as soon as I set up mrtg again, I´m gonna read up on 
>  the kernel-sources)

The problem with using /proc/stat is the values presented on the cpu
line are running totals of jiffies spent in user, nice, system, and
idle respectively.  So, you have to read /proc/stat at least twice and
then calculate the deltas (and average over the time delta if you seek
an average.  Reading man proc and the source code (proc_misc.c;
function kstat_read_proc) helped a lot; man proc seems a bit out of
date WRT 2.4.x kernels.

Yesterday I wrote a perl script that does this (I'm playing with
cricket ... see

  http://canaris.visionary.micromuse.com/cgi-bin/cricket/grapher.cgi?target=%2Fservers

I'll make the script source available if someone wants it ... I use a
db file to store the readings from each run for use in the next run.

My loadavg figures come from /proc/loadavg ... I wasn't interested in
any heavy lifting :)

Now for the mem stats ...

-- 
Nathan Norman - Staff Engineer | A good plan today is better
Micromuse Ltd. | than a perfect plan tomorrow.
mailto:[EMAIL PROTECTED]   |   -- Patton

 PGP signature


Re: Starving Student Needs Help

2001-09-06 Thread Starving Student

Hey, 
 
Try out 3webXS.  You can register for it at http://www.get3web.com.  I
used to be a free 3web user and then I upgraded to XS.  It's so much
better.  The ads are gone and so are the busy tones.  I get on without
a problem and never get booted off.  When I upgraded, I spoke with an
agent who assured me that the service was just as good as Sprint or
Bell.  I haven't been disappointed so far!  I love it.  Try it out, I
am sure that you'd like it too!


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]