码迷,mamicode.com
首页 > 其他好文 > 详细

第十篇、【Zabbix监控项之自定义监控磁盘IO】

时间:2020-01-02 15:47:45      阅读:245      评论:0      收藏:0      [点我收藏+]

标签:orm   director   file   start   option   单位   png   code   safe   

一、自定义监控项获取磁盘IO所需的值

1、在zabbix Agent端配置文件配置如下内容

[root@YZS_3WYY_WEB ~]# vi /usr/local/zabbix-4.4.3/etc/zabbix_agentd.conf
    305 ### Option: UserParameter
    306 #       User-defined parameter to monitor. There can be several user-defined parameters.
    307 #       Format: UserParameter=<key>,<shell command>
    308 #       See zabbix_agentd directory for examples.
    309 #
    310 # Mandatory: no
    311 # Default:
    312 # UserParameter=
    313 UnsafeUserParameters=1
    314 UserParameter=custom.vfs.dev.read.ops[*],cat /proc/diskstats | grep $1 | head -1 | awk {print $$4}
    315 UserParameter=custom.vfs.dev.write.ops[*],cat /proc/diskstats | grep $1 | head -1 | awk {print $$8}
    316 UserParameter=custom.vfs.dev.read.sectors[*],cat /proc/diskstats | grep $1 | head -1 | awk {print $$6}
    317 UserParameter=custom.vfs.dev.write.sectors[*],cat /proc/diskstats | grep $1 | head -1 | awk {print $$10}
    318 

 1.1、监控项的介绍

custom.vfs.dev.read.ops[*]                  //磁盘读的次数
custom.vfs.dev.write.ops[*]                 //磁盘写的次数
custom.vfs.dev.read.sectors[*]              //读速率
custom.vfs.dev.write.sectors[*]             //写速率
//*表示要传入的参数即是$1

2、配置完成后,重启Agent服务

[root@YZS_3WYY_WEB ~]# /etc/init.d/zabbix_agentd restart

 3、本地测试是否生效

[root@YZS_3WYY_WEB ~]# /usr/local/zabbix-4.4.3/bin/zabbix_get -s 127.0.0.1 -p 10050 -k "custom.vfs.dev.read.ops[xvde1]"
114833

 4、服务端测试是否生效

[root@filestore-v2 ~]# /data/application/zabbix-4.4.3/bin/zabbix_get -s 192.168.10.100 -p 10050 -k "custom.vfs.dev.read.ops[xvde1]"
114833

 

二、在Zabbix Web端开始配置

1、配置磁盘读次数监控项

1.1、增加读次数的监控项

监控项的值:
custom.vfs.dev.read.ops[xvde1]

单位:ops(每秒操作的次数)

进程:每秒更改

 

技术图片

技术图片

2、配置磁盘写次数监控项

2.1、增加写次数的监控项

监控项的值:
custom.vfs.dev.write.ops[xvde1]

单位:ops(每秒操作的次数)

进程:每秒更改

 技术图片

技术图片

3、配置硬盘IO读写次数画图

 技术图片

 

3.1、画图效果

技术图片


 

4、配置磁盘读速率监控项

4.1、增加读速率的监控项

监控项的值:
custom.vfs.dev.read.sectors[xvde1]

单位:b/s 字节/秒

进程:每秒更改和 自定义倍数512(一个扇区512字节)

技术图片

技术图片

5、配置磁盘写速率监控项

监控项的值:
custom.vfs.dev.write.sectors[xvde1]

单位:b/s 字节/秒

进程:每秒更改和 自定义倍数512(一个扇区512字节)

技术图片

技术图片

5.1、配置画图

 技术图片

5.2、查看画图的效果

 技术图片

6、触发器根据需求,自行配置,这里不在单独介绍

 

第十篇、【Zabbix监控项之自定义监控磁盘IO】

标签:orm   director   file   start   option   单位   png   code   safe   

原文地址:https://www.cnblogs.com/ygbh/p/12125582.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!