Show iostat
result in Zabbix.
Assume the Zabbix agent directory is /zabbix-agent/.
Since the first output of iostat
is the statistics since boot time, we need to wait for a period (like 10 seconds) to get the result, which should be done through cron job, otherwise it'll surpass the zabbix agent's timeout.
Do the following two steps:
- Copy iostat-cron.sh to /zabbix-agent/bin/;
- Copy iostat-cron.conf to /etc/cron.d/;
After a while, you'll see the iostat-data file in /zabbix-agent/var/.
To expose the iostat-data to Zabbix, do the following steps:
- Copy dev-discovery.sh and iostat-check.sh to /zabbix-agent/bin/, the former one is to enable disk device discovery capability.
- Copy iostat-params.conf to /zabbix-agent/etc/zabbix_agentd.conf.d/.
Import iostat-template.xml, and link it to a host.
Some of the scripts are from https://github.com/zbal/zabbix.