[xymon] iostat monitor

Vernon Everett everett.vernon at gmail.com
Thu Sep 16 04:16:28 CEST 2010


Hi Daniel

This is significantly different to the Solaris output. Linux gives a few
extra fields, and leaves out a few that Solaris has.
We may need to play with this to find some common ground.
Alternatively, we just accept and embrace the differences, and add a few
extra graphs.
We then set a SUBTEST string within the case statement.
The loop will then be
for subtest in $SUBTEST

The output I used was as below.
Make yours look similar, and we have a winner.

The output then gets massaged a little with this set of commands (commented
for clarity)
 cat $TEMPFILE.raw | awk "NR>$LINE" \  # take only the last set
                   | sed "s/,/ /g" \   # make it space seperated
                   | awk '{ print $NF" "$0 }' \ # move device name to front
                   | awk '{ $NF="";print }' > $TEMPFILE.data # Dump the
device name at the end

iostat -xrn 2 2
extended device statistics
r/s,w/s,kr/s,kw/s,wait,actv,wsvc_t,asvc_t,%w,%b,device
1.4,3.9,93.0,68.8,0.0,0.2,0.0,47.0,0,3,vdc0
0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.2,0,0,vdc1
1.4,4.0,92.8,68.8,0.0,0.3,0.0,61.0,0,4,vdc2
0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0,0,blackbox:/data/scratch
0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0,0,infdomB1:/export/DRhome
0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.7,0,0,infdomB1:/export/home
0.0,0.0,0.0,0.0,0.0,0.0,0.0,9.1,0,0,infdomD2:/data/software
extended device statistics
r/s,w/s,kr/s,kw/s,wait,actv,wsvc_t,asvc_t,%w,%b,device
0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0,0,vdc0
0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0,0,vdc1
0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0,0,vdc2
0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0,0,blackbox:/data/scratch
0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0,0,infdomB1:/export/DRhome
0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0,0,infdomB1:/export/home
0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0,0,infdomD2:/data/software

>From man iostat
     -n          Display names in descriptive format.  For  exam-
                 ple, cXtYdZ, rmt/N, server:/export/path.
     -r          Display data in a comma-separated format.
     -x          Report extended  disk  statistics.


 Output
     The output of the  iostat  utility  includes  the  following
     information.

     device    name of the disk

     r/s       reads per second

     w/s       writes per second

     kr/s      kilobytes read per second
               The average I/O size during the  interval  can  be
               computed from kr/s divided by r/s.

     kw/s      kilobytes written per second
               The average I/O size during the  interval  can  be
               computed from kw/s divided by w/s.

     wait      average number of transactions waiting for service
               (queue length)
               This is the number of I/O operations held  in  the
               device  driver queue waiting for acceptance by the
               device.

     actv      average number of transactions actively being ser-
               viced  (removed  from  the  queue but not yet com-
               pleted)

               This is the number of I/O operations accepted, but
               not yet serviced, by the device.

     svc_t     average response time  of  transactions,  in  mil-
               liseconds
               The svc_t  output  reports  the  overall  response
               time,  rather  than the service time, of a device.
               The overall time includes the time  that  transac-
               tions  are in queue and the time that transactions
               are being serviced. The time  spent  in  queue  is
               shown  with  the  -x  option  in the wsvc_t output
               column. The time spent servicing  transactions  is
               the  true service time. Service time is also shown
               with the -x option and appears in the asvc_t  out-
               put column of the same report.

     %w        percent of time there are transactions waiting for
               service (queue non-empty)

     %b        percent of time the disk is busy (transactions  in
               progress)

     wsvc_t    average  service  time  in  wait  queue,  in  mil-
               liseconds

     asvc_t    average service time of  active  transactions,  in
               milliseconds

     wt        the I/O wait time is no  longer  calculated  as  a
               percentage  of  CPU  time, and this statistic will
               always return zero.

Cheers
    Vernon




On Wed, Sep 15, 2010 at 10:27 PM, Daniel Bourque
<dbourque at weatherdata.com>wrote:

> here is a sample run.
> $ iostat -xd 5 2
> Linux 2.6.18-92.1.22.el5PAE (host.bla.com)        09/15/2010
>
> Device:         rrqm/s   wrqm/s   r/s   w/s   rsec/s   wsec/s avgrq-sz
> avgqu-sz   await  svctm  %util
> sda               0.00     0.00  0.00  0.00     0.07     0.00    92.89
> 0.00    4.31   3.78   0.00
> sdb              23.63     8.98 21.65 27.30    14.39   120.96     2.77
> 0.10    1.95   1.55   7.59
> dm-0              0.00     0.00  0.11  3.01     2.27    24.08     8.44
> 0.04   11.50   1.04   0.32
> dm-1              0.00     0.00  0.34  1.80     6.38    14.38     9.71
> 0.02   10.15   1.59   0.34
> dm-2              0.00     0.00  0.00  0.33     0.01     2.62     8.00
> 0.00    7.70   3.09   0.10
> dm-3              0.00     0.00  0.47 28.77    33.15    90.77     4.24
> 0.06    2.03   0.17   0.51
> dm-4              0.00     0.00  0.00  0.00     0.00     0.00     8.00
> 0.00   18.27   2.54   0.00
> dm-5              0.00     0.00 44.45  2.42   111.93   123.38     5.02
> 0.02    0.37   1.59   7.45
> drbd0             0.00     0.00 44.45 128.36   111.89    51.42     4.88
> 0.10    3.45   3.94  13.17
>
> Device:         rrqm/s   wrqm/s   r/s   w/s   rsec/s   wsec/s avgrq-sz
> avgqu-sz   await  svctm  %util
> sda               0.00     0.00  0.00  0.00     0.00     0.00     0.00
> 0.00    0.00   0.00   0.00
> sdb               0.00    35.40  3.80 69.20    32.00   821.20    11.69
> 0.04    0.59   0.52   3.76
> dm-0              0.00     0.00  0.20  2.80     3.20    22.40     8.53
> 0.00    1.13   1.13   0.34
> dm-1              0.00     0.00  0.00  1.80     0.00    14.40     8.00
> 0.00    0.00   0.00   0.00
> dm-2              0.00     0.00  0.00  0.60     0.00     4.80     8.00
> 0.00    0.00   0.00   0.00
> dm-3              0.00     0.00  0.00  2.00     0.00    16.00     8.00
> 0.00    0.00   0.00   0.00
> dm-4              0.00     0.00  0.00  0.00     0.00     0.00     0.00
> 0.00    0.00   0.00   0.00
> dm-5              0.00     0.00  3.60 97.40    28.80   761.00     7.82
> 0.04    0.40   0.34   3.40
> drbd0             0.00     0.00  3.60 94.80    28.80   758.40     8.00
> 0.09    0.96   0.56   5.48
>
>
> I whish the maintainer of iostat would add a friendly name option, it would
> not be so hard to code a device-mapper -> LVM translation using "dmsetup ls"
> , problem is you can only run that command as root. ( guess you could add a
> sudo rule... )
>
> anyways, if you don't find the time to work on this, just just provide a
> sample output of solaris's /usr/bin/iostat -xrn and I'll post the changes
> needed to the list.
>
> Thank !
>
>
> Dan
>
>
>
> Vernon Everett wrote:
>
>> Could give it a go.
>> Send me the output of iostat -x 2 2 for your favourite OS(s)
>>
>> Where I am now, I only have Solaris, hence the bias.
>>
>> Cheers
>>    V
>>
>>
>> On Wed, Sep 15, 2010 at 5:22 AM, Daniel Bourque <dbourque at weatherdata.com<mailto:
>> dbourque at weatherdata.com>> wrote:
>>
>>    Sorry I can't reply to the thread for some reason i quit receiving
>>    the emails, I checked the archive and noticed the replies to my
>>    former thread. ( thanks ! )
>>
>>    Vernon, since I don't run solaris here, only linux and some tru64,
>>    the -r ( csv output ) and -n ( friendly names ) options makes it
>>    hard to use your shell script since they either don't exists or
>>    don't work the same. Can you perhaps provide a same output of
>>     "iostat -xrn" and along with formated text you pass to hobbit in
>>    your check.
>>
>>    I can then provide a snippet of code for linux, which would
>>    provide the equivalent output. So you could just add a case in the
>>    shell script.
>>
>>
>>    case `uname` in
>>      Linux)
>>        /usr/bin/iostat -x $DURATION 2 | wonderful stuff > $TEMPFILE.raw
>>         ;;
>>      SunOS)
>>        /usr/bin/iostat -xrn $DURATION 2 > $TEMPFILE.raw
>>        ;;
>>    esac
>>
>>
>>
>>    --     Dan
>>
>>
>>    To unsubscribe from the xymon list, send an e-mail to
>>    xymon-unsubscribe at xymon.com <mailto:xymon-unsubscribe at xymon.com>
>>
>>
>>
>>
> To unsubscribe from the xymon list, send an e-mail to
> xymon-unsubscribe at xymon.com
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20100916/379d7563/attachment.html>


More information about the Xymon mailing list