очень определенный вывод iostat, необходимый в в реальном времени

Мы смотрели на что-то на работе на прошлой неделе, названной "Чувак" для Windows MicroTik - похож на закрытый исходный код, но это свободно использовать. Схема, которую это автоматически нарисовало нашей коммутируемой среды LAN, была очень хороша. Мы планируем исследовать его далее...

Если бы Вы собираетесь быть тестированием большого количества новых приложений управления сетью Windows, я рекомендовал бы использовать VMware так, чтобы каждая установка могла использовать "чистую" среду Windows - на основе опыта, к тому времени, когда Вы устанавливаете 2 или 3, Ваш ПК начнет становиться немного неработоспособным.

2
задан 23 August 2012 в 17:23
4 ответа

I'm not sure how to get the iostat formatting you're looking for. The tool I use for this type of monitoring, though, is customizable to the point where you could display the relevant fields. It's also excellent for generating data for replay and graphing purposes.

I use Collectl monitoring (available in CentOS via yum), and the disk check flags should give you what you need:

collectl -sD --dskfilt sda

Sample output (you can change the units and columns printed):

collectl -sD --dskfilt sdb
waiting for 1 second sample...

# DISK STATISTICS (/sec)
#          <---------reads---------><---------writes---------><--------averages--------> Pct
#Name       KBytes Merged  IOs Size  KBytes Merged  IOs Size  RWSize  QLen  Wait SvcTim Util
sdb              0      0    0    0     336      0   52    6       6     0     0      0    1
sdb             16      0    1   16     389      1   52    7       7     0     0      0    3
sdb              0      0    0    0    1236      9  109   11      11     0     0      0    0
sdb             16      0    1   16     676      3  140    5       4     0     1      1   14
sdb              0      0    0    0      64      1   16    4       4     0     2      1    2
2
ответ дан 3 December 2019 в 09:40

Why not creating a wrapper in bash ?

One-liner version would look like :

iostat 1 2 | grep -w sda | tail -1 | awk {'print $7'}

This will run iostat twice, and return the right value of await (which is 7th column)

You can do the same with vmstat by passing the right column to awk to get whole CPU iowait. For example :

vmstat 1 2 | tail -1 | awk {'print $16'}

Note that iostat and vmstat is different on each linux distribution and you have to pick the right column.

1
ответ дан 3 December 2019 в 09:40

This seems like something that should be monitorable with munin, graphite, etc.

EDIT: If your system has watch, you can set the iostat to automatically run a given (or infinitely-reapeating) number of times, with a specified gap between runs! awk out the fields that you actually want!

1
ответ дан 3 December 2019 в 09:40

rereading the original question if the author is looking for real-time info, I agree collectl is the way to go. that's why I wrote it. ;)

if there is some specific thing you're trying to do with the data perhaps I could help but I'd need to know more. as for how real-time you want to be, you can choose any sub-second monitoring interval you like.

-mark

1
ответ дан 3 December 2019 в 09:40

Теги

Похожие вопросы