监控系列讲座(十二)常见系统监控指标之存储

2020-08-17  本文已影响0人  炼狱腾蛇Eric

4. 磁盘/存储监控指标

一般来说,我们监控存储设备的时候大多数都是在监控文件系统,也就是可以被操作系统直接使用的部分。但是实际的生产中,我们会有其他的监控需求

这块我们后面会在讲分布式存储和Ceph的时候再详细说,我们这里只比较一下一些工具内置模板可以监控到的指标。

4.1. 系统上查看硬盘指标

同样是两类

其实系统上能看到的指标是最全面的,而我们常用的vmstat命令提供的指标也非常少

   Swap
       si: Amount of memory swapped in from disk (/s).
       so: Amount of memory swapped to disk (/s).

   IO
       bi: Blocks received from a block device (blocks/s).
       bo: Blocks sent to a block device (blocks/s).

只有swap分区的读和写,块存储的读和写。我们经常会使用iostat -d来查看硬盘的IO

$ iostat
Linux 2.6.32-431.11.15.el6.ucloud.x86_64 (ssdk1)     10/14/2016     _x86_64_    (4 CPU)

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           0.44    0.00    0.26    0.01    0.01   99.29

Device:            tps   Blk_read/s   Blk_wrtn/s   Blk_read   Blk_wrtn
vda               0.66         0.09         6.75    1404732  105885456
vdb               1.42        12.47        55.86  195619082  876552296

这个会显示所有的每块盘的速度

tps:该设备每秒的传输次数
Blk_read/s:每秒从设备(drive expressed)读取的数据量;
Blk_wrtn/s:每秒向设备(drive expressed)写入的数据量;
Blk_read:  读取的总数据量;
Blk_wrtn:写入的总数量数据量;

然后就是df命令了,他会显示磁盘的使用率,这个是是很重要的指标,因为如果磁盘满了,和CPU一样,某些运行的程序可能会由于无法写数据而意外终止。

df -H
Filesystem      Size  Used Avail Use% Mounted on
/dev/root       126G  2.0G  119G   2% /
devtmpfs        1.9G     0  1.9G   0% /dev
tmpfs           2.0G     0  2.0G   0% /dev/shm
tmpfs           2.0G  8.8M  2.0G   1% /run
tmpfs           5.3M  4.1k  5.3M   1% /run/lock
tmpfs           2.0G     0  2.0G   0% /sys/fs/cgroup
/dev/mmcblk0p1  265M   55M  210M  21% /boot
tmpfs           400M     0  400M   0% /run/user/1000

4.2. zabbix上的存储监控指标

和我们在系统上看到的指标大同小异

image-20200724235135473.png file

4.3. grafana上的存储监控指标

多了一个inode的监控,其他的基本一样

image-20200725000108563.png file

4.4. node_exporter上的存储监控指标

这边的监控貌似多了很多

# HELP node_disk_discard_time_seconds_total This is the total number of seconds spent by all discards.
# TYPE node_disk_discard_time_seconds_total counter
node_disk_discard_time_seconds_total{device="mmcblk0"} 0
node_disk_discard_time_seconds_total{device="mmcblk0p1"} 0
node_disk_discard_time_seconds_total{device="mmcblk0p2"} 0
# HELP node_disk_discarded_sectors_total The total number of sectors discarded successfully.
# TYPE node_disk_discarded_sectors_total counter
node_disk_discarded_sectors_total{device="mmcblk0"} 0
node_disk_discarded_sectors_total{device="mmcblk0p1"} 0
node_disk_discarded_sectors_total{device="mmcblk0p2"} 0
# HELP node_disk_discards_completed_total The total number of discards completed successfully.
# TYPE node_disk_discards_completed_total counter
node_disk_discards_completed_total{device="mmcblk0"} 0
node_disk_discards_completed_total{device="mmcblk0p1"} 0
node_disk_discards_completed_total{device="mmcblk0p2"} 0
# HELP node_disk_discards_merged_total The total number of discards merged.
# TYPE node_disk_discards_merged_total counter
node_disk_discards_merged_total{device="mmcblk0"} 0
node_disk_discards_merged_total{device="mmcblk0p1"} 0
node_disk_discards_merged_total{device="mmcblk0p2"} 0
# HELP node_disk_io_now The number of I/Os currently in progress.
# TYPE node_disk_io_now gauge
node_disk_io_now{device="mmcblk0"} 0
node_disk_io_now{device="mmcblk0p1"} 0
node_disk_io_now{device="mmcblk0p2"} 0
# HELP node_disk_io_time_seconds_total Total seconds spent doing I/Os.
# TYPE node_disk_io_time_seconds_total counter
node_disk_io_time_seconds_total{device="mmcblk0"} 11.476
node_disk_io_time_seconds_total{device="mmcblk0p1"} 0.44
node_disk_io_time_seconds_total{device="mmcblk0p2"} 11.064
# HELP node_disk_io_time_weighted_seconds_total The weighted # of seconds spent doing I/Os.
# TYPE node_disk_io_time_weighted_seconds_total counter
node_disk_io_time_weighted_seconds_total{device="mmcblk0"} 16.476
node_disk_io_time_weighted_seconds_total{device="mmcblk0p1"} 0.668
node_disk_io_time_weighted_seconds_total{device="mmcblk0p2"} 15.792
# HELP node_disk_read_bytes_total The total number of bytes read successfully.
# TYPE node_disk_read_bytes_total counter
node_disk_read_bytes_total{device="mmcblk0"} 2.32966144e+08
node_disk_read_bytes_total{device="mmcblk0p1"} 1.153536e+07
node_disk_read_bytes_total{device="mmcblk0p2"} 2.20890112e+08
# HELP node_disk_read_time_seconds_total The total number of seconds spent by all reads.
# TYPE node_disk_read_time_seconds_total counter
node_disk_read_time_seconds_total{device="mmcblk0"} 11.972
node_disk_read_time_seconds_total{device="mmcblk0p1"} 0.704
node_disk_read_time_seconds_total{device="mmcblk0p2"} 11.232000000000001
# HELP node_disk_reads_completed_total The total number of reads completed successfully.
# TYPE node_disk_reads_completed_total counter
node_disk_reads_completed_total{device="mmcblk0"} 4883
node_disk_reads_completed_total{device="mmcblk0p1"} 416
node_disk_reads_completed_total{device="mmcblk0p2"} 4447
# HELP node_disk_reads_merged_total The total number of reads merged.
# TYPE node_disk_reads_merged_total counter
node_disk_reads_merged_total{device="mmcblk0"} 6505
node_disk_reads_merged_total{device="mmcblk0p1"} 3795
node_disk_reads_merged_total{device="mmcblk0p2"} 2710
# HELP node_disk_write_time_seconds_total This is the total number of seconds spent by all writes.
# TYPE node_disk_write_time_seconds_total counter
node_disk_write_time_seconds_total{device="mmcblk0"} 26.967000000000002
node_disk_write_time_seconds_total{device="mmcblk0p1"} 0.008
node_disk_write_time_seconds_total{device="mmcblk0p2"} 26.958000000000002
# HELP node_disk_writes_completed_total The total number of writes completed successfully.
# TYPE node_disk_writes_completed_total counter
node_disk_writes_completed_total{device="mmcblk0"} 1456
node_disk_writes_completed_total{device="mmcblk0p1"} 3
node_disk_writes_completed_total{device="mmcblk0p2"} 1453
# HELP node_disk_writes_merged_total The number of writes merged.
# TYPE node_disk_writes_merged_total counter
node_disk_writes_merged_total{device="mmcblk0"} 2529
node_disk_writes_merged_total{device="mmcblk0p1"} 0
node_disk_writes_merged_total{device="mmcblk0p2"} 2529
# HELP node_disk_written_bytes_total The total number of bytes written successfully.
# TYPE node_disk_written_bytes_total counter
node_disk_written_bytes_total{device="mmcblk0"} 6.9829632e+07
node_disk_written_bytes_total{device="mmcblk0p1"} 5120
node_disk_written_bytes_total{device="mmcblk0p2"} 6.9824512e+07
node_scrape_collector_duration_seconds{collector="diskstats"} 0.001754445
node_scrape_collector_success{collector="diskstats"} 1

2020 CKA考试视频 真题讲解 https://www.bilibili.com/video/BV167411K7hp

2020 CKA考试指南 https://www.bilibili.com/video/BV1sa4y1479B/

2020年 5月CKA考试真题 https://mp.weixin.qq.com/s/W9V4cpYeBhodol6AYtbxIA

上一篇下一篇

猜你喜欢

热点阅读