I need to capture the following data on an hourly basis through cronjob scheduling:-
- load averages
- Total no. of processes.
- CPU state
- Memory
- Top 3 process details.
All the above information is available through the command 'top'. But here we need to automate the same and save it in a log file for the purpose of monitoring the server performance.
Please find the below data which exactly I need to capture:-
load averages: 0.30, 0.29, 0.24
90 processes: 88 sleeping, 2 on cpu
CPU states: 97.7% idle, 1.7% user, 0.6% kernel, 0.0% iowait, 0.0% swap
Memory: 16G real, 11G free, 3333M swap in use, 13G swap free
PID USERNAME LWP PRI NICE SIZE RES STATE TIME CPU COMMAND
29490 oms1 47 0 12 172M 140M cpu/0 55:40 0.75% java
2436 sroy 1 59 0 7208K 6088K cpu/8 0:54 0.52% top
2482 avijay 1 32 0 7080K 5960K sleep 0:01 0.26% top
Request you to please provide some idea or any automation script how the above activity can be performed.
Thank you all in advance.
---------- Post updated at 11:06 PM ---------- Previous update was at 10:54 PM ----------
Sorry for not mentioning, the requirement is for Solaris 10 environment.