# Nagios飞信linux系统免费短信报警配置
http://www.uddtm.com/os/linux/Nagiosfeixinlinuxxitongmianfeiduanxinbaojingpeizhi.php
一、fetion20091117
wget http://www.it-adv.net/fetion/downng/library_linux.tar.gz
wget http://www.it-adv.net/fetion/downng/fetion20090406003-linux.tar.gz
wget http://www.it-adv.net/fetion/downng/fetion20091117-linux.tar.gz
#在安装飞信之前需要在/usr/lib目录下加上libACE库文件,以便使飞信能够正常使用
[root@localhost src]# tar zxvf library_linux.tar.gz
[root@localhost src]# mv libACE* libcrypto.so.0.9.8 libssl.so.0.9.8 /usr/lib
#正式安装飞信
[root@localhost src]# tar zxvf fetion20090406003-linux.tar.gz
[root@localhost src]# mv install /usr/local/fetion
[root@localhost src]# chmod -R 755 /usr/local/fetion
[root@localhost src]# chown -R nagios:nagios /usr/local/fetion
#移动服务器更新,需要更新软件
[root@localhost src]# tar zxvf fetion20091117-linux.tar.gz
[root@localhost src]# cp fx/* /usr/local/fetion
[root@localhost src]# vi /etc/ld.so.conf
include ld.so.conf.d/*.conf
/usr/local/fetion #增加目录
[root@localhost src]# ldconfig
[root@localhost src]#/usr/local/fetion/fetion –mobile=151***** –pwd=*** –to=151***** –msg-utf8=”test” –debug
测试一下成功:
[root@gateway ~]# /usr/local/fetion/fetion –mobile=15814456575 –pwd=wan@@@@ –to=15814456575 –msg-utf8=”test” –debug
[ 15:51:50.498131] [User.cpp] [1152] nav.fetion.com.cn=221.130.45.201
[ 15:51:50.498344] [User.cpp] [1170] Before connect to nav.fetion.com.cn
[ 15:51:50.552685] [User.cpp] [1182] After connected to nav.fetion.com.cn
[ 15:51:50.902410] [SystemConfig.cpp] [65] sipc-proxy=221.176.31.42:8080
[ 15:51:50.902470] [SystemConfig.cpp] [76] parseSystemConfig 221.176.31.42:8080
[ 15:51:50.914752] [User.cpp] [1266] Before connect to nav.fetion.com.cn:443
[ 15:51:51.110999] [User.cpp] [1279] After connect to nav.fetion.com.cn:443
[ 15:51:51.214854] [User.cpp] [982] parseSSIResult:15814456575 689692699 7045 309442439 101
[ 15:51:51.385258] [User.cpp] [1328] After connected to 221.176.31.42:8080
[ 15:51:52.302978] [User.cpp] [1114] getPublicIP:112.95.145.152
[ 15:51:52.303033] [User.cpp] [1378] Register renew time:600
[ 15:51:52.303171] [User.cpp] [853] sending to:15814456575
[ 15:51:52.303206] [User.cpp] [857] run,using cmcc mobile:15814456575
Send Msg to:
TP=3 ID=309442439 LO=0 SU=0 RE=0 SI=689692699 SE=7045 MO=15814456575 GR= ST=101 RE=1 OL=499 NN=15814456575LN=
SIP-C/2.0 280 Send SMS OK
T: sip:689692699@fetion.com.cn;p=7045
I: 2
Q: 1 M
[root@localhost src]#/usr/local/fetion/fetion ##帮助
[root@localhost src]#cp /usr/local/fetion/fetion /usr/bin/
配置contacts.cfg
define contact {
contact_name admin
alias system admin
host_notification_period 24×7
service_notification_period 24×7
host_notification_options d,r
service_notification_options c,w,r
service_notification_commands notify-service-by-fetion,notify-service-by-email
# service_notification_commands notify-service-by-email
host_notification_commands notify-host-by-fetion,notify-host-by-email
pager 1312323232323 #手机号
}
配置miscommands.cfg文件
define command {
command_name notify-host-by-fetion
command_line /usr/bin/fetion –mobile=13422222222 –pwd=xxxxxxxx –to=$CONTACTPAGER$ –msg-utf8=”Host $HOSTSTATE$ alert for $HOSTNAME$! on ‘$LONGDATETIME$’” $CONTACTPAGER$
}
define command {
command_name notify-service-by-fetion
command_line /usr/bin/fetion –mobile=134663xxxx –pwd=xxxxxxxx –to=$CONTACTPAGER$ –msg-utf8=”$HOSTADDRESS$ $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ on $LONGDATETIME$” $CONTACTPAGER$
}
注:参考文档 http://750826.blog.51cto.com/740826/202514

