ZABBIX所有的报告、统计、参数配置都可以通过一个基于WEB 的前端程序访问。Zabbix报警脚本 防网络抖动 无需在zabbix里设置报警选项 用计划任务来就行 希望大家帮忙完善
- #!/bin/bash
- ############################
- #Create By [email]Dennis__cao@hotmail.com[/email]
- #2008/06/18
- #Blog:[url]www.mlives.cn[/url]
- ################################
- /usr/bin/mysql zabbix -e 'select FROM_UNIXTIME(t.lastchange),h.ip, h.host, t.description, f.lastvalue from functions as f left join items as i on f.itemid=i.itemid left join hosts as h on i.hostid = h.hostid left join triggers as t on f.triggerid = t.triggerid where f.triggerid in (select triggerid from triggers where value=1 and status=0 and lastchange < UNIX_TIMESTAMP(DATE_sub(now(),INTERVAL 3 minute))) order by f.triggerid;'> /home/zabbix/bin/log.txt
- if [ -s /home/zabbix/bin/log.txt ];then
- mail -s "Zabbix Monitor" [email]mail@mail.com[/email] < /home/zabbix/bin/log.txt
- RECODER=`cat /home/zabbix/bin/log.txt |wc -l`
- i=2
- until [[ $i > $RECODER ]]
- do
- /home/zabbix/bin/sms PHONENUMBER "`sed -n -e ${i}p /home/zabbix/bin/log.txt`" >/dev/null 2>&1
- let ii=i+1
- done
- fi
【编辑推荐】