FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora User

 
 
LinkBack Thread Tools
 
Old 12-22-2007, 09:38 AM
"Peter Lauri"
 
Default top -b -n 1

Hi,

I am just creating a very simple system performance monitoring script. I am parsing the output of the following command and writes it to a text file:

top -b -n 1 | egrep '^Cpu'

I run "top" as normal in the shell during the execution, but that one is oscilating a lot. However, the "top -b -n 1" just changes very slowly. It feels like the top -b gives some sort of "average" value to the values.


If so , how can I set it to have shorter "average" rate?

/Peter

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 
Old 12-22-2007, 10:18 PM
John Summerfield
 
Default top -b -n 1

Peter Lauri wrote:

Hi,

I am just creating a very simple system performance monitoring script. I am
parsing the output of the following command and writes it to a text file:

top -b -n 1 | egrep '^Cpu'

I run "top" as normal in the shell during the execution, but that one is
oscilating a lot. However, the "top -b -n 1" just changes very slowly. It
feels like the top -b gives some sort of "average" value to the values.

This is nearer to running it "normally."
top -b -n20 | egrep '^Cpu'



If so , how can I set it to have shorter "average" rate?


-d
but be realistic, you don't want top dominating the system.


--

Cheers
John

-- spambait
1aaaaaaa@coco.merseine.nu Z1aaaaaaa@coco.merseine.nu
-- Advice
http://webfoot.com/advice/email.top.php
http://www.catb.org/~esr/faqs/smart-questions.html
http://support.microsoft.com/kb/555375

You cannot reply off-list:-)

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 
Old 12-23-2007, 01:09 PM
"Peter Lauri"
 
Default top -b -n 1

-d is just giving the "Delay Time" so it is not giving me what I need. I need top to just output the current status to STDOUT and after that exit. The only way to do that is to go with the -b option, but that one seams to be "averaging" the values instead of giving the current status.


So to move out of the "top box": how can I get a "snap shot" of the current CPU load?

/Peter


On Dec 23, 2007 1:18 AM, John Summerfield <
debian@herakles.homelinux.org> wrote:

-d
but be realistic, you don't want top dominating the system.



--

Cheers
John

-- spambait
1aaaaaaa@coco.merseine.nu *Z1aaaaaaa@coco.merseine.nu
-- Advice

http://webfoot.com/advice/email.top.php
http://www.catb.org/~esr/faqs/smart-questions.html

http://support.microsoft.com/kb/555375

You cannot reply off-list:-)

--
fedora-list mailing list

fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list


--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 
Old 12-24-2007, 04:43 PM
John Cornelius
 
Default top -b -n 1

How about uptime?



--jc



Peter Lauri wrote:

-d is just giving the "Delay Time" so it is not giving me
what I need. I need top to just output the current status to STDOUT and
after that exit. The only way to do that is to go with the -b option,
but that one seams to be "averaging" the values instead of giving the
current status.




So to move out of the "top box": how can I get a "snap shot" of the
current CPU load?



/Peter





On Dec 23, 2007 1:18 AM, John Summerfield
<
debian@herakles.homelinux.org> wrote:



-d

but be realistic, you don't want top dominating the system.






--



Cheers

John



-- spambait

1aaaaaaa@coco.merseine.nu
*Z1aaaaaaa@coco.merseine.nu

-- Advice

http://webfoot.com/advice/email.top.php

http://www.catb.org/~esr/faqs/smart-questions.html


http://support.microsoft.com/kb/555375



You cannot reply off-list:-)



--

fedora-list mailing list

fedora-list@redhat.com

To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list








--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 
Old 12-25-2007, 09:56 AM
"Tod Merley"
 
Default top -b -n 1

On Dec 23, 2007 6:09 AM, Peter Lauri <peterlauri@gmail.com> wrote:
> -d is just giving the "Delay Time" so it is not giving me what I need. I
> need top to just output the current status to STDOUT and after that exit.
> The only way to do that is to go with the -b option, but that one seams to
> be "averaging" the values instead of giving the current status.
>
> So to move out of the "top box": how can I get a "snap shot" of the current
> CPU load?
>
> /Peter
>
>
>
>
> On Dec 23, 2007 1:18 AM, John Summerfield < debian@herakles.homelinux.org>
> wrote:
> >
> > -d
> > but be realistic, you don't want top dominating the system.
> >
> >
> > --
> >
> > Cheers
> > John
> >
> > -- spambait
> > 1aaaaaaa@coco.merseine.nu Z1aaaaaaa@coco.merseine.nu
> > -- Advice
> > http://webfoot.com/advice/email.top.php
> > http://www.catb.org/~esr/faqs/smart-questions.html
> > http://support.microsoft.com/kb/555375
> >
> > You cannot reply off-list:-)
> >
> > --
> > fedora-list mailing list
> > fedora-list@redhat.com
> > To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
> >
>
>
> --
> fedora-list mailing list
> fedora-list@redhat.com
> To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
>

Hi Peter Lauri!

Thanks! You moved me to find a cool tool. In the sysstat package is a
command called sar. Please note the following session:
----------------------------------------------------------------------------------
[tod@localhost ~]$ sar -u 1 5
Linux 2.6.23.8-34.fc7 (localhost.localdomain) 12/25/2007

02:46:47 AM CPU %user %nice %system %iowait %steal %idle
02:46:48 AM all 7.07 0.00 2.02 0.00 0.00 90.91
02:46:49 AM all 85.00 0.00 4.00 0.00 0.00 11.00
02:46:50 AM all 8.00 0.00 3.00 0.00 0.00 89.00
02:46:51 AM all 7.00 0.00 1.00 0.00 0.00 92.00
02:46:52 AM all 6.00 0.00 3.00 0.00 0.00 91.00
Average: all 22.65 0.00 2.61 0.00 0.00 74.75
[tod@localhost ~]$ sar -u 1 5
Linux 2.6.23.8-34.fc7 (localhost.localdomain) 12/25/2007

02:47:11 AM CPU %user %nice %system %iowait %steal %idle
02:47:12 AM all 8.00 0.00 2.00 0.00 0.00 90.00
02:47:13 AM all 7.00 0.00 3.00 0.00 0.00 90.00
02:47:14 AM all 7.00 0.00 3.00 0.00 0.00 90.00
02:47:15 AM all 7.07 0.00 2.02 0.00 0.00 90.91
02:47:16 AM all 6.93 0.00 2.97 0.00 0.00 90.10
Average: all 7.20 0.00 2.60 0.00 0.00 90.20
[tod@localhost ~]$ sar -u 1 5 > cpu.txt
[tod@localhost ~]$ cat cpu.txt
Linux 2.6.23.8-34.fc7 (localhost.localdomain) 12/25/2007

02:47:35 AM CPU %user %nice %system %iowait %steal %idle
02:47:36 AM all 7.00 0.00 2.00 0.00 0.00 91.00
02:47:37 AM all 7.92 0.00 2.97 0.99 0.00 88.12
02:47:38 AM all 5.10 0.00 1.02 0.00 0.00 93.88
02:47:39 AM all 4.95 0.00 1.98 0.00 0.00 93.07
02:47:40 AM all 6.06 0.00 2.02 0.00 0.00 91.92
Average: all 6.21 0.00 2.00 0.20 0.00 91.58
[tod@localhost ~]$
--------------------------------------------------------------------------
Actually you can cause the program to create a binary file and then
use it again to display the binary data normally. You have full
control of interval. You also have a lot of cool troubleshooting
options such as finding how much a specific process is using the CPU.

I found the package for my Fedora 7 using Applications > Add/Remove
Software, clicking the Search tab, and then entering sysstat.

Enjoy!

Tod

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 
Old 12-25-2007, 11:11 AM
Peter Lauri
 
Default top -b -n 1

On Tue, 2007-12-25 at 02:56 -0800, Tod Merley wrote:
> Hi Peter Lauri!
>
> Thanks! You moved me to find a cool tool. In the sysstat package is a
> command called sar. Please note the following session:
> ----------------------------------------------------------------------------------
> [tod@localhost ~]$ sar -u 1 5

Thanks, this is what I need. It will fit very well into my system
monitor daemon(s)...

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 

Thread Tools




All times are GMT. The time now is 05:10 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org