标签:style class blog code http tar
需要用到的东西:
vi /usr/local/zabbixagent/conf/zabbix_agentd.conf Include=/usr/local/zabbixagent/conf/zabbix_agentd :wq
# required sysstat # required iostat running backgroud ################################################## # nohup iostat -k -x -d 30 > /usr/local/zabbixagent/tmp/iostats & # chown zabbix:zabbix /usr/local/zabbixagent/tmp/iostats # cronteb -e # Zabbix Agent‘s task for disk I/O # 59 23 * * * iostat -k -x -d 30 2 > /usr/local/zabbixagent/tmp/iostats & ################################################## # command for test. #/usr/local/zabbixagent/bin/zabbix_get -s 10.0.0.1 -k ‘io.rps[sda]‘ #/usr/local/zabbixagent/bin/zabbix_get -s 10.0.0.1 -k ‘io.wps[sda]‘ #/usr/local/zabbixagent/bin/zabbix_get -s 10.0.0.1 -k ‘io.rkbps[sda]‘ #/usr/local/zabbixagent/bin/zabbix_get -s 10.0.0.1 -k ‘io.wkbps[sda]‘ #/usr/local/zabbixagent/bin/zabbix_get -s 10.0.0.1 -k ‘io.avgrq-sz[sda]‘ #/usr/local/zabbixagent/bin/zabbix_get -s 10.0.0.1 -k ‘io.avgqu-sz[sda]‘ #/usr/local/zabbixagent/bin/zabbix_get -s 10.0.0.1 -k ‘io.await[sda]‘ #/usr/local/zabbixagent/bin/zabbix_get -s 10.0.0.1 -k ‘io.svctm[sda]‘ #/usr/local/zabbixagent/bin/zabbix_get -s 10.0.0.1 -k ‘io.util[sda]‘ ################################################## UserParameter=io.scandisk[*],/usr/local/zabbixagent/scripts/discovery-linux.py /proc/diskstats 3 UserParameter=io.rps[*],grep -a "$1" /usr/local/zabbixagent/tmp/iostats | tail -1 |awk ‘{print $$4}‘ UserParameter=io.wps[*],grep -a "$1" /usr/local/zabbixagent/tmp/iostats | tail -1 |awk ‘{print $$5}‘ UserParameter=io.rkbps[*],grep -a "$1" /usr/local/zabbixagent/tmp/iostats | tail -1 |awk ‘{print $$6}‘ UserParameter=io.wkbps[*],grep -a "$1" /usr/local/zabbixagent/tmp/iostats | tail -1 |awk ‘{print $$7}‘ UserParameter=io.avgrq-sz[*],grep -a "$1" /usr/local/zabbixagent/tmp/iostats | tail -1 |awk ‘{print $$8}‘ UserParameter=io.avgqu-sz[*],grep -a "$1" /usr/local/zabbixagent/tmp/iostats | tail -1 |awk ‘{print $$9}‘ UserParameter=io.await[*],grep -a "$1" /usr/local/zabbixagent/tmp/iostats | tail -1 |awk ‘{print $$10}‘ UserParameter=io.svctm[*],grep -a "$1" /usr/local/zabbixagent/tmp/iostats | tail -1 |awk ‘{print $$11}‘ UserParameter=io.util[*],grep -a "$1" /usr/local/zabbixagent/tmp/iostats | tail -1 |awk ‘{print $$12}‘
cd /usr/local/zabbixagent/ mkdir tmp scripts chmod 775 tmp scripts touch tmp/iostats chmod 644 tmp/iostats touch scripts/discovery-linux.py chmod 754 scripts/discovery-linux.py chown zabbix:zabbix ./* -R
nohup iostat -k -x -d 30 > /usr/local/zabbixagent/tmp/iostats & sudo service zabbix_agentd restart
/usr/local/zabbixagent/bin/zabbix_get -s 10.0.0.1 -k ‘io.rps[sda]‘ /usr/local/zabbixagent/bin/zabbix_get -s 10.0.0.1 -k ‘io.wps[sda]‘ /usr/local/zabbixagent/bin/zabbix_get -s 10.0.0.1 -k ‘io.rkbps[sda]‘ /usr/local/zabbixagent/bin/zabbix_get -s 10.0.0.1 -k ‘io.wkbps[sda]‘ /usr/local/zabbixagent/bin/zabbix_get -s 10.0.0.1 -k ‘io.avgrq-sz[sda]‘ /usr/local/zabbixagent/bin/zabbix_get -s 10.0.0.1 -k ‘io.avgqu-sz[sda]‘ /usr/local/zabbixagent/bin/zabbix_get -s 10.0.0.1 -k ‘io.await[sda]‘ /usr/local/zabbixagent/bin/zabbix_get -s 10.0.0.1 -k ‘io.svctm[sda]‘ /usr/local/zabbixagent/bin/zabbix_get -s 10.0.0.1 -k ‘io.util[sda]‘
crontab -e 59 8 * * * iostat -k -x -d 30 2 > /usr/local/zabbixagent/tmp/iostats &
Zabbix监控Linux磁盘I/O,布布扣,bubuko.com
标签:style class blog code http tar
原文地址:http://www.cnblogs.com/rexkang/p/zabbix-monitor-disk-io-of-linux.html