zabbix配置短信发送方式

配置环境:ubuntu+zabbix
一.操作系统位数:32bit
1.首先是下载包
包名是fetion20091117-linux.tar.gz
[url]http://bbs.it-adv.net/viewthread.php?tid=916&extra=page%3D1[/url] 包下载地址
2.下解解压后,需要把fx目录下fetion这个文件换成最新的(上面网址论坛里会有提示更新,我现在更新的fetion大小为415kb,也许再过段时间会有新的更新)。
3.进入解压目录中的fx目录,然后执行如下操作(注:#号后面的才是需要输入的命令)
# cd fx
# ./fetion
./fetion: error while loading shared libraries: libACE-5.7.2.so: cannot open shared object file: No such file or directory
# cp libACE-5.7.2.so /lib/
# ./fetion
./fetion: error while loading shared libraries: libACE_SSL-5.7.2.so: cannot open shared object file: No such file or directory
# cp libACE_SSL-5.7.2.so /lib
#./fetion
./fetion: error while loading shared libraries: libssl.so.4: cannot open shared object file: No such file or directory
# cp libssl.so.4 /lib
#./fetion
./fetion: error while loading shared libraries: libcrypto.so.4: cannot open shared object file: No such file or directory
# cp libcrypto.so.4 /lib/

以上的意思是需要把相应的so库导到/lib下,这样执行fetion时才能找到执行的相关文件。
4.出现如下提示就是表示可以发送短信了
# ./fetion
************************ IMPORTANT STATEMENT ************************
** **
** PLEASE DON’T USE THIS SOFTWARE TO SEND JUNK SHORT MESSAGES. **
** OTHERWISE PLEASE BEAR YOUR OWN CONSEQUENCES. **
** **
** Version:[20091117002-linux] **
*********************************************************************
This program is the console version of China Fetion!
It’s free for personal user.
This project website: http://www.it-adv.net/

AUTHOR:KelvinH MSN/EMAIL:shichangguo@msn.com

Usage:
–mobile=[mobile]
–sid=[sid]
–pwd=[pwd]
–config=[config file] *format:index mobile password
–index=[index no in config file,refer to sample.conf]

–debug *debug mode on
–hide *login fetion in hidden state
–to=[mobile/sid]
–add=[uri]
–command-path=[command file path]
–robotmode
–daemon(linux only)
–proxy-ip(http proxy ip)
–proxy-port(http proxy port)
–msg-gb=[gb2312/gbk message]
–msg-utf8=[utf8 message]
–msg-type=[0/1/2/3 sms longsms smartmsg mms]
–file-gb=[gb2312/gbk file]
–file-utf8=[utf8 file]
–query-cmcc-no
–testaccount
–auto-retry
–get-web-session
–action=getpiccode –mobile=13910000000 –pwd=[pwd] (–piccode-url=[url])
–action=appsubscribe –mobile=[mobile] –pwd=[pwd] –pic-certificate-id=[certid] –pic-cert-code=[certcode] –apply-sub-service-url=[url]
–action=subscribe –mobile=[mobile] –pwd=[pwd] –sms-code=[smscode] –subscribe-url=[url]
–action=updatepwd –mobile=[mobile] –pwd=[pwd] –sms-code=[smscode] –update-pwd-url=[url]

5.测试是否成功
注:到电信用手机号注册个飞信账号,如:手机号:15888888888,密码:pwd888888
./fetion –mobile=15888888888 –pwd=pwd888888 –to=15888888888 –msg-utf8="Hello world"

到这步你的手机会收到短信提示了,还有点需要注意,-to参数必须是你飞信的好友
6.写成脚本
mkdir /home/zabbix/bin
cd /home/zabbix/bin
vi sendsms.sh
fx(这里应该是fx绝对路径,视具体情况而定)/fetion –mobile=15888888888 –pwd=pwd888888 –to=$1 –msg-utf8="$2 $3"

保存退出
6.配置zabbix
Administrator->Media Type->Create Media Type
这里有几个地方需要注意:
Description:短信
Type:Script
Script name:sendsms.sh
然后
创建一个zabbix用户,添加media类型短信,输入需要发送到的手机号码(如:15888888888)
创建Action(具体见zabbix官方API)
创建Trigger(同上)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值