白天和黑夜只交替没交换无法想像对方的世界
分类: 系统运维
2013-06-19 11:11:45
一、挂载iso镜象,配置使用本地yum源:
# mount -o loop /apps/software/centos-6.2-x86_64-bin-dvd1.iso /mnt
# rm -rf /etc/yum.repos.d/*
# vim /etc/yum.repos.d/dvd.repo
加入以下内容:
[dvd]
name=install dvd
baseurl=file:///mnt
enabled=1
gpgcheck=0
#yum makecache
然后就可以使用yum命令安装你所需要的软件包了
二、安装配置fetion机器人:
1.上传fetion包及安装lib库文件:
# cd /data/monitor/nagios/libexec
# rz fetion.2013-06-19.tar.gz (此处实际操作,是要上传你本地已经下载的fetion包)
# tar xvfz fetion.2013-06-19.tar.gz
# cd fetion
# cp -r /usr/lib /usr/lib.bak
# cp -r linuxso_20101113/* /usr/lib/
# yum install /lib/ld-linux.so.2
# yum install -y libstdc .so.6 libgssapi_krb5.so.2 libz.so.1
2.验证机器人是否正常:
# ./fetion
************************ important statement ************************
** **
** please don't use this software to send junk short messages. **
** otherwise please bear your own consequences. **
** **
** version:[20101205002-linux] **
*********************************************************************
this program is the console version of china fetion!
it's free for personal user.
this project website:
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]
--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 sms longsms smartmsg]
--file-gb=[gb2312/gbk file]
--file-utf8=[utf8 file]
--query-cmcc-no
--auto-retry
--exit-on-verifycode
--t3key=[]
至此,飞信机器人就可以正常发送短信了。如果,经过上面的安装配置,仍然存在一些问题,请稳步到步骤三:
三、现网遇到的问题:
1.在安装libgssapi_krb5.so.2时,出现如下错误:
# yum install libgssapi_krb5.so.2
loaded plugins: fastestmirror, refresh-packagekit, security
loading mirror speeds from cached hostfile
dvd | 4.0 kb 00:00 ...
setting up install process
resolving dependencies
--> running transaction check
---> package krb5-libs.i686 0:1.9-22.el6 will be installed
--> finished dependency resolution
error: protected multilib versions: krb5-libs-1.9-22.el6.i686 != krb5-libs-1.10.3-10.el6_4.3.x86_64
you could try using --skip-broken to work around the problem
you could try running: rpm -va --nofiles --nodigest
于是,根据提示尝试添加--skip-broken参数,使用rpm -va --nofiles --nodigest命令均无效。想到强制卸载64位的版本:
# rpm -e krb5-libs-1.10.3-10.el6_4.3.x86_64 --nodeps
# rpm -qa|grep krb5-libs-1.10.3-10.el6_4.3.x86_64
卸载后,再执行yum安装命令,却又报出如下错误:(yum报废了,郁闷啊!)
# yum install libgssapi_krb5.so.2
there was a problem importing one of the python modules
required to run yum. the error leading to this problem was:
libgssapi_krb5.so.2: cannot open shared object file: no such file or directory
please install a package which provides this module, or
verify that the module is installed correctly.
it's possible that the above module doesn't match the
current version of python, which is:
2.6.6 (r266:84292, dec 7 2011, 20:48:22)
[gcc 4.4.6 20110731 (red hat 4.4.6-3)]
if you cannot solve this problem yourself, please go to
the yum faq at:
别着急,办法还是有的,活人不能被xx死啊!哈哈!
换一种思路,yum不行了,咱们不是还有rpm嘛。现在,就尝试如下操作:
解决办法:
# rpm -ivh /mnt/packages/krb5-libs-1.9-22.el6.i686.rpm
preparing... ########################################### [100%]
1:krb5-libs ########################################### [100%]
# rpm -ivh /mnt/packages/krb5-libs-1.9-22.el6.x86_64.rpm
preparing... ########################################### [100%]
1:krb5-libs ########################################### [100%]
# ./fetion
************************ important statement ************************
** **
** please don't use this software to send junk short messages. **
** otherwise please bear your own consequences. **
** **
** version:[20101205002-linux] **
*********************************************************************
this program is the console version of china fetion!
it's free for personal user.
this project website:
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]
--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 sms longsms smartmsg]
--file-gb=[gb2312/gbk file]
--file-utf8=[utf8 file]
--query-cmcc-no
--auto-retry
--exit-on-verifycode
--t3key=[]
接下来,可以进行测试一下飞信机器人发送短信,操作如下:
# sh sendsms.sh 15811283479 "this fetion alarm test,please reply me."
sip-c/4.0 280 send sms ok
t: sip:755792951@fetion.com.cn;p=30015
i: 2
q: 1 m
l: 113
xi: 7e30d99149cc47518b8da914f1e3af59
看到如上提示,说明短信发送成功。
注意:第一次测试发送短信时,会出现一个对话提示,这时候会在当前目录下生成一个以手机号命名的验证码图片(例如名为:15811283479.jpg 的验证码图片),只需切换到其他session下将其下载至本地查看,将验证码输入到前面的对话提示后,回车即可。以后,再发送短信时,就不需要验证码了。
涉及到的fetion包及发送短信的脚本sendsms.sh,均以附件的形式上传。
2014-03-19 13:09:11
:还未搭建好环境,回头测试,能否转帖?
楼主,这网盘共享已取消了。附件无法下载。
|2014-03-19 13:07:38
还未搭建好环境,回头测试,能否转帖?