Someone asked a script, in order to average the output of vmstat command.
In order to do this, I made a python script. You can find it, here.
You can use it in tow ways.
- Save the output of vmstat into a file, then use my script
- Run my script interactively
- Save the output of vmstat into a file, then use my script
i. run vmstat and save the output
oracle> vmstat 5 5 > vmstat out
ii. Use my script
oracle> cat vmstat.out|vmstat.py
============
Samples: 4
============
Avg Proc : 30.2 (Sum=121, Min=18, Max=37)
Avg User : 19.0 (Sum=76, Min=18, Max=20)
Avg System : 10.8 (Sum=43, Min=10, Max=11)
Avg Idle : 67.2 (Sum=269, Min=65, Max=68)
Avg Waiting: 3.0 (Sum=12, Min=1, Max=5)
Avg Stolen : 0.0 (Sum=0, Min=0, Max=0)
- Run my script interactively
i. run vmstat and pipe my script
oracle> vmstat 5 5 |vmstat.py
============
Samples: 4
============
Avg Proc : 46.5 (Sum=186, Min=22, Max=61)
Avg User : 22.5 (Sum=90, Min=21, Max=25)
Avg System : 14.8 (Sum=59, Min=14, Max=16)
Avg Idle : 57.2 (Sum=229, Min=49, Max=60)
Avg Waiting: 5.2 (Sum=21, Min=3, Max=10)
Avg Stolen : 0.0 (Sum=0, Min=0, Max=0)
It works on Linux, Solaris, AIX and HP-UX.
I also made a script that read the vmstat output from the Oracle OS Watcher. Here an example
oracle> cat myserver_vmstat_17.03.15.1300.dat |osWatchVmstat.py
============
Samples: 162
============
Avg Proc : 40.2 (Sum=6511, Min=37, Max=37)
Avg User : 14.9 (Sum=2420, Min=22, Max=22)
Avg System : 8.2 (Sum=1336, Min=16, Max=16)
Avg Idle : 71.4 (Sum=11570, Min=41, Max=41)
Avg Waiting: 5.4 (Sum=868, Min=22, Max=22)
Avg Stolen : 0.0 (Sum=0, Min=0, Max=0)
I also made a script that read the vmstat output from the Oracle OS Watcher. Here an example
oracle> cat myserver_vmstat_17.03.15.1300.dat |osWatchVmstat.py
============
Samples: 162
============
Avg Proc : 40.2 (Sum=6511, Min=37, Max=37)
Avg User : 14.9 (Sum=2420, Min=22, Max=22)
Avg System : 8.2 (Sum=1336, Min=16, Max=16)
Avg Idle : 71.4 (Sum=11570, Min=41, Max=41)
Avg Waiting: 5.4 (Sum=868, Min=22, Max=22)
Avg Stolen : 0.0 (Sum=0, Min=0, Max=0)
where "myserver_vmstat_17.03.15.1300.dat" is the output from OS Watch
Nessun commento:
Posta un commento