Chinaunix首页 | 论坛 | 博客
  • 博客访问: 7910
  • 博文数量: 4
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 10
  • 用 户 组: 普通用户
  • 注册时间: 2013-07-07 21:24
文章分类

全部博文(4)

文章存档

2014年(3)

2013年(1)

我的朋友

分类: 系统运维

2013-07-07 21:25:22

最近,新上一批服务器,安装的操作系统为:Centos6.2_x86_64。应监控需要,想在其中的一台管理机上安装配置飞信机器人报警。但是,安装配置中,遇到N多难缠的问题。网上有人说,centos6.0以后,飞信机器人的支持效果不太好。但是,经过本人实践发现,centos6.0-centos6.4都是可以成功安装配置的。下面是以Centos6.2_x86_64系统为例,说明如何配置飞信报警机器人,实现手机接收报警短信!

一、挂载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,均以附件的形式上传。提取密码:d1wj

阅读(865) | 评论(0) | 转发(0) |
0

上一篇:没有了

下一篇:SNMP从入门到开发:基础篇

给主人留下些什么吧!~~