Operating System - HP-UX
1753511 Members
5054 Online
108795 Solutions
New Discussion юеВ

Script to check what processes running when disk busy reach above 80%

 
mir4take
Occasional Advisor

Script to check what processes running when disk busy reach above 80%

Hi Gurus,

I'm not expert in scripting and need your help to share with me how to extract data with other script's output. I need to have a script to check what processes running when the disk busy reach above 80%. For disk busy we use #sar -d and check on 3rd column (%busy). To check processes we need to run #ps -ef. But how can I intergrate these two commands?

 

lonwin03:/home/admamir/perf # sar -d 5 5
HP-UX lonwin03 B.11.31 U ia64    08/08/11
08:59:07   device   %busy   avque   r+w/s  blks/s  avwait  avserv
08:59:12    disk3    2.19    0.50       3      58    0.00   16.27
                 disk2    0.20    0.50       0       6    0.00    4.91
08:59:17    disk3    1.60    0.50       2      40    0.00   20.75
                    disk2    0.60    0.50       1      13    0.00   10.09
08:59:22    disk3    1.40    0.50       2      32    0.00   10.32
                    disk2    1.60    0.50       1       8    0.00   38.24
08:59:27    disk3    2.38    0.50       4      51    0.00   15.48
                    disk2    0.79    0.50       1       6    0.00   15.03
08:59:32    disk3    2.63    0.50       4      56    0.00   22.11
                    disk2    1.01    0.50       1       5    0.00   12.87
Average     disk3    2.04    0.50       3      47    0.00   17.22
Average     disk2    0.84    0.50       1       8    0.00   17.13
3 REPLIES 3
Dennis Handly
Acclaimed Contributor

Re: Script to check what processes running when disk busy reach above 80%

>But how can I integrate these two commands?

 

Possibly only by looking at the glance output.  I don't know if pstat(2) provides this info?

Johnson Punniyalingam
Honored Contributor

Re: Script to check what processes running when disk busy reach above 80%

http://h30499.www3.hp.com/t5/System-Administration/Which-Processes-causing-High-disk-utilization/m-p/4481089/highlight/true#M362528

 

please check above link if its usefull.

 

Regards,

Johnson

Problems are common to all, but attitude makes the difference
Hein van den Heuvel
Honored Contributor

Re: Script to check what processes running when disk busy reach above 80%

The value of 'disk busy' is over-rated. 

You may want to focus on raw IO rate.

 

Instead of watching iostat as a first trigger, you may want to go straight to  a process view ans declare yourself per-process IO IO threshholds. But please realize that the the IO might not be done directly, but through some helper, like update for the cache writes, or maybe and Oracle database-write process.

 

You may want to describe the application a little bit if you need further help, as many application have better source-level performance indicators then second guessing it from OS data can provide (Oracle, SAP,...)

 

Glance has options to display per process IO stats, but I don't think that is easy to script.

You may need a help program based on pstat data

http://h20000.www2.hp.com/bc/docs/support/SupportManual/c02267025/c02267025.pdf )

Check out for example:

http://yong321.freeshell.org/freeware/pio.html#hpux

 

Hope this helps some,

Hein

HvdH Performance Consulting.