[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference 7.286::korn_shell_programming

Title:Welcome to Korn_Shell_Programming
Moderator:PLUGH::needle
Created:Tue Jun 25 1991
Last Modified:Fri May 30 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:118
Total number of notes:426

117.0. "script to collect statistics" by HANDVC::QA () Thu May 08 1997 07:38

1) is this the most correct way to display the belowed statistic at a 
    particular instance :

- cpu utilization (pcpu)
- memory utilization (pmem)
- I/O utilization (inblock,oublock)
- SWAP utilization (nswap)

Now to collect one sample of system statistics, I do :
               ^^^^^^^^^^

> ps -o ucomm,pmem,nswap,inblock,oublock,pcpu
COMMAND          %MEM NSWAP INBLK OUBLK %CPU
csh               0.3     0    14     8  0.0
netscape          9.6     0  8143  6848  0.0


2) now I want to calculate the peak and average of these statistics 
   for each day                            
    
- cpu utilization (pcpu)
- memory utilization (pmem)
- I/O utilization (inblock,oublock)
- SWAP utilization (nswap)

by collecting samples every 15 min, how can I write a script
to calculate the peak and average with the collected samples ?

I will have 4 samples per hour so I will have 4X24= 96 samples.
    
    
3) next I want to calculate the above statistics but :

- by user name
- by process name
- for the whole system
    
    How should I modify the above script ?

4) finally I want to store the statistics for each day :

- peak and average cpu utilization
- peak and average memory utilization
- peak and average I/O utilization
- peak and average SWAP utilization

and calculate the peak and average for the month. 

what will be the easiest way to do by scripting ?





T.RTitleUserPersonal
Name
DateLines