Remote Host Monitoring - iostat Command needs changes
search cancel

Remote Host Monitoring - iostat Command needs changes

book

Article ID: 252713

calendar_today

Updated On:

Products

APM

Issue/Introduction

Hi Team,

 

In Brief:

This is regarding Write Wait Time(ms) metric in the Remote Host Monitoring configuration. You should change the formula, so as to obtain accurate values.

Existing Formula (Incorrect): iostat -x

Correct Formula: iostat -xy 1 1

 

In Detail:

As per ~/apmia/extensions/~/config/linux.json, this metric (i.e. Write Wait Time (ms)) is obtained from 'iostat -x'. However, this command provides the average result since the system had booted and this is inaccurate.

For example, if we execute 'iostat -x 2', the 1st report from iostat will always print statistics based on the last time the system was booted; so, this is not correct, and we must disregard this. The next report provides values based on the time since the last interval.

Example: The following command lists 18.84 as Write Wait Time in the first report, while it shows as 1.00 in the next reports

# iostat -x 2
Linux 3.10.0-1160.31.1.el7.x86_64 (gcp-use1-casb-prd-con-ms-10-239-10-166)      10/04/2022      _x86_64_        (8 CPU)

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
          32.15    0.00   15.32    0.00    0.00   52.53

Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util
sdd               0.00     0.16    0.32    1.31    33.98   223.72   317.17     0.03   15.57    2.22   18.84   0.54   0.09
sdb               0.00     0.00    0.00    0.00     0.00     2.63 83045.27     0.00    2.58    0.14    2.81   3.14   0.00
sdc               0.00     0.00    0.00    0.00     0.00     2.63 266967.03     0.00    0.89    0.54    1.06   0.63   0.00
sda               0.00     0.10    0.59    0.71    27.68     7.74    54.74     0.00    2.62    4.35    1.19   0.45   0.06

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
          35.70    0.00   12.58    0.00    0.00   51.72

Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util
sdd               0.00     0.00    0.00    1.00     0.00     4.00     8.00     0.00    1.00    0.00    1.00   2.00   0.20
sdb               0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00    0.00    0.00   0.00   0.00
sdc               0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00    0.00    0.00   0.00   0.00
sda               0.00     0.00    0.00    3.00     0.00    12.00     8.00     0.00    0.33    0.00    0.33   1.17   0.35

 

Changes Required:

Just as you utilize iostat -dy  1 1 to obtain values for KBytes Read Per Second, No. of I/O Requests Per Second, etc., you should use similar thing for Write Wait Time (ms), Read Wait Time (ms), etc.

Environment

Release : 1

Resolution

Linux.json file fixed and can be found in DE547599