先到论坛上下载对应版本的fetion,我用的centos 5.6 x86_64的系统,软件包在文章最后附件中.
1. 解压到/root/bin/目录下.
2 .修改/etc/ld.so.conf 添加fetion所在目录/root/bin/fetion/ 并运行ldconfig –v
3. 测试 /root/bin/fetion/fetion --mobile=138xxxxxxxx --pwd=password --to=138xxxxxxxx --msg-utf8="test fetion"
若不成功按照提示检查,然后新建脚本在/root/bin/sendsms.sh
#!/bin/bash
all="$*"
msg=`echo $all |cut -d' ' -f2-`
/root/bin/fetion/fetion --mobile=138xxxxxxxx --pwd=password --to=138xxxxxxxx --msg-utf8="$msg"
然后修改zabbix 配置文件/etc/zabbix/zabbix_server.conf中的AlertScriptsPath值为脚本所在目录:
#AlertScriptsPath=/home/zabbix/bin/
AlertScriptsPath=/root/bin/
修改完别忘了重启哦.
4.在zabbix web的配置 Administration—> Media types
5.为用户添加新的media. Type 选择fetion 然后在填上手机号码.