- 论坛徽章:
- 0
|
那里有监控主机性能(内存、i/o、cpu)使用情况的脚本?谢谢!
可以使用nmon工具,省去写脚本的麻烦了,并且可以通过excel出图形分析:
For Data-Collect-Mode = spreadsheet format (comma separated values)
Note: use only one of f,F,z,x or X and make it the first argument
-f spreadsheet output format [note: default -s300 -c288]
output file is <hostname>;_YYYYMMDD_HHMM.nmon
-F <filename>; same as -f but user supplied filename
-r <runname>; goes into spreadsheet file [default hostname]
-t include top processes in the output
-T as -t plus saves command line arguments in UARG section
-s <seconds>; between snap shots
-c <number>; of refreshes
-l <dpl>; disks/line default 150 to avoid spreadsheet issues. EMC=64
.
-g <filename>; User decided Disk Groups (see above -g)
-D Skip disk configuration sections
-E Skip ESS configuration sections
-W Include WLM sections
-I <percent>; Ignore process percent threshold (default 0.1)
don't save TOP stats if proc using less CPU than this %
-A Include Async I/O Section
-m <dir>; nmon changes to this directory before saving data to a fil
e
example: collect for 1 hour at 30 second intervals with top procs
nmon64 -f -t -r Test1 -s30 -c120
To load into a spreadsheet like Lotus 1-2-3:
sort -A *nmon >;stats.csv
transfer the stats.csv file to your PC
Start 1-2-3 and then Open <char-separated-value ASCII file>;
Capacity planning mode - use cron to run each day
-x sensible spreadsheet output for CP = one day
every 15 mins for 1 day ( i.e. -ft -s 900 -c 96)
-X sensible spreadsheet output for CP = busy hour
every 30 secs for 1 hour ( i.e. -ft -s 30 -c 120) |
|