|
|
|
|
||||||
| comp.unix.shell Using and programming the Unix shell. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
How to capture cpu utilisation in 15 minute interval through a script.
Thanks in advance... |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
sangram wrote:
> How to capture cpu utilisation in 15 minute interval through a script. $ sar 900 count Where count is how many 15 minute intervals you want covered. You can redirect the output to a file or use the -o option of sar to write it to a file. If you want to do it indefinitely (e.g. until you kill or otherwise stop the process) you could also do something like: while :; do sar 900 1 >>file done Precisely what sar outputs for you by default might vary depending on your flavor of sar, so you may need to check sar and possibly adjust options accordingly. The batch utility can also be utilized to run the program detached from the terminal. references: sar(1) sh(1) batch(1) crontab(1) |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
Michael Paoli wrote: > sangram wrote: > > How to capture cpu utilisation in 15 minute interval through a script. > $ sar 900 count > Where count is how many 15 minute intervals you want covered. You > can redirect the output to a file or use the -o option of sar to > write it to a file. If you want to do it indefinitely (e.g. until > you kill or otherwise stop the process) you could also do something > like: > while :; do > sar 900 1 >>file > done > Precisely what sar outputs for you by default might vary depending on > your flavor of sar, so you may need to check sar and possibly adjust > options accordingly. The batch utility can also be utilized to run > the program detached from the terminal. Sar is actually probably the only thing we can thank SCO for :-) ( http://aplawrence.com/Words2005/2005_03_16.html ) But most sar I've used will take sar 900 0 as meaning indefinitely. -- Tony Lawrence Unix/Linux/Mac OS X Resources http://aplawrence.com |
|
![]() |
| Outils de la discussion | |
|
|