Send statistic from /proc/diskstats to Zabbix
This is small project for my Home server
- AutoDiscovery BlockDev and Filter by LLD Override
- Collect Read\Write Operations per second
- Collect Read\Write Sectors per second
- Calculate Time for 1 Read\Write Operations
- Trigger when IO_Time >30ms at 10 times per 20min
- Collect IO Queue
- Convert DM(Device Mapper) device to pretty Name
- Get stat for
dm-1
but print for uservg00-lv_root
- After reboot
dm-1
may change todm-2
, but stat will be correct
- Get stat for
- Not work with Zabbix_agent2
- Add script to server
# Create dir for zabbix sript
mkdir -p /usr/libexec/zabbix/
# Copy script to your server
curl 'https://raw.githubusercontent.com/dusharu/ZBX_Disk_Stat/master/scripts/disk_stat.sh' -o /usr/libexec/zabbix/disk_stat.sh
chmod 755 /usr/libexec/zabbix/disk_stat.sh
- Import Template_ZBX/latest/ZBX_Disk_Stat.xml
- Check LLD Override. Default value:
- ^$ - result FALSE - device was remove
- .snapshot. - result FALSE - filter LVM snapshot
- -real$ - result FALSE - filter LVM snapshot
- -cow$ - result FALSE - filter LVM snapshot
- ^xvd[a-z]*[0-9]+$ - result FALSE - filter partitions
- ^[hs]d[a-z]*[0-9]+$ - result FALSE - filter partitions
- ^loop[0-9]*$ - result FALSE - filter loop device
- ^sr[0-9]*$ - result FALSE - filter CD-ROM
- Add host to group "Disk_Stat: io_block_dev"
- Wait before Zabbix Discovery and Get Some Data
Graph create by Grafana and Zabbix plugin
- Template_ZBX - Zabbix Template
- scripts - Scripts for Zabbix Agent
- README.md - information for Users
- Screenshoots - Screensoot for README.md
- LICENSE - license file
zabbix_get -s <HOST> -k 'system.run[ "/usr/libexec/zabbix/disk_stat.sh" ]'
zabbix_get -s <HOST> -k 'system.run[ "/usr/libexec/zabbix/disk_stat.sh blkdev_discovery" ]'
zabbix_get -s <HOST> -k 'system.run[ "/usr/libexec/zabbix/disk_stat.sh blkdev_all_stat <DISK>" ]'
- kernel.org: Describe /proc/diskstats
- kernel.org: I/O statistics fields
- Wikipedia.org: maximum IOPS on different Disk
- RAID calcuator
- Linux Filesystem Hierarchy Standard: /usr/libexec
- Add link with information about maximum IO_time
- Add plugin for zabbix_agent2