Zabbix 监控磁盘IO

Zabbix 监控磁盘IO

 

1.数据获取脚本

#!/bin/bash
# resource: http://www.muck.net/19/getting-hard-disk-performance-stats-from-zabbix
# Author: Ca0gu0
# 

driver=$1
args=$2
case $args in
    read_ops)
        grep $driver /proc/diskstats | head -1 | awk '{print $4}'
    ;;

    "read_ms")
        grep $driver /proc/diskstats | head -1 | awk '{print $7}'
    ;;

    "write_ops")
        grep $driver /proc/diskstats | head -1 | awk '{print $8}'
    ;;

    "write_ms")
        grep $driver /proc/diskstats | head -1 | awk '{print $11}'
    ;;

    "io_active")
        grep $driver /proc/diskstats | head -1 | awk '{print $12}'
    ;;

    "io_ms")
        grep $driver /proc/diskstats | head -1 | awk '{print $13}'
    ;;

    "read_sectors")
        grep $driver /proc/diskstats | head -1 | awk '{print $6}'
    ;;

    "write_sectors")
        grep $driver /proc/diskstats | head -1 | awk '{print $10}'
    ;;

    *)   
        echo "Not found data"
        exit 0
     ;;
esac

 

 

 

2.效果如下

 

 

posted @ 2015-12-04 15:33  ca0guo  阅读(669)  评论(0编辑  收藏  举报