设为首页 收藏本站
查看: 2134|回复: 0

nagios安装飞信

[复制链接]

尚未签到

发表于 2019-1-15 09:02:12 | 显示全部楼层 |阅读模式
  一、安装所需要的软件
  总下载地址:http://bbs.it-adv.net/viewthread.php?tid=1081&extra=page%3D1
  wget http://www.it-adv.net/fetion/linuxso_20101113.rar
  //下面的这个连接是下载飞信的可执行文件fetion,要注册回复后才能看到
  http://bbs.it-adv.net/attachment.php?aid=43&k=954fb0d183808bfb706d8c4a35308874&t=1335168710
  //下面的这个连接是下载rar的解压缩软件文件的软件
  wget http://www.rarlab.com/rar/rarlinux-3.9.2.tar.gz
  二、解压下载的软件
  1,安装rar的解压缩软件
  tar zxvf rarlinux-3.9.2.tar.gz
  cd rar
  make && make install
  make时如果报以下
  rar: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
  解决方法:
  [root@localhost download]# yum install libstdc++.so.6
  2、创建fetion目录
  mkdir /usr/local/fetion
  rar x linuxso_20101113.rar
  cp ./lib* /usr/local/fetion
  把下载的fetion执行程序拷贝过去到fetion目录中,并修改fetion目录属主和属组为nagios,增加执行权限
  3、增加飞信所需的动态链接库
  vi /etc/ld.so.conf
  /usr/local/fetion
  4、这一步最关键,否则系统识别不到
  ldconfig   --更新/usr/local/fetion中的库文件,能够被系统识别
  5、手动执行fetion,看是否报错:
  /usr/local/fetion/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: 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]
  --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=[http://www.tui3.com/page/smssend/]
  6】测试
  root># /usr/local/fetion/fetion --mobile=1371xx --pwd=xx --to=1371xx --msg-utf8="阿萨"
  SIP-C/4.0 280 Send SMS OK
  T: sip:203294876@fetion.com.cn;p=3044
  I: 2
  Q: 1 M
  L: 116
  D: Wed, 12 Dec 2012 03:41:17 GMT
  XI: 8EB4A6172FA8AD75614FB3CC323AD8F0
  --其中pwd为该手机的飞信密码,并不是139密码;如果出现send sms ok的话,就说明已经发生成功了,一般第一次发生的时候,会在fetion目录生成该手机的jpg
  7】修改commands.cfg
  define command {
  command_name    notify-service-by-fetion
  command_line    /usr/local/fetion/fetion --mobile=1371xx --pwd=xx --msg-utf8="***Nagios***\nNotification Type: $NOTIFICATIONTYPE$\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n$SERVICEOUTPUT$ " --to=1371xx
  }
  define command {
  command_name    notify-host-by-fetion
  command_line    /usr/local/fetion/fetion --mobile=1371xx --pwd=xx --msg-utf8="***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\nDate/Time: $LONGDATETIME$\n " --to=1371xx
  }
  --其中to后面可以是contacts.cfg里面的联系人
  信息格式可以随便修改,也可以这样写
  define command{
  command_name    notify-host-by-fetion
  command_line    /usr/local/fetion/fetion --mobile=1371x --pwd=xx --msg-utf8="***Nagios***\nNotification Type: $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$"  --to=1371xx
  }
  # 'notify-service-by-fetion' command definition
  define command{
  command_name    notify-service-by-fetion
  command_line    /usr/local/fetion/fetion --mobile=1371 --pwd=xx --msg-utf8="***Nagios***\nNotification Type: $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$"  --to=xx
  }
  8】修改contacts.cfg,增加pager
  define contact {
  contact_name                       nagiosadmin
  alias                              nagios administrator
  service_notification_period        24x7
  host_notification_period           24x7
  service_notification_options       w,u,c,r
  host_notification_options          d,u,r
  service_notification_commands      notify-service-by-fetion,notify-service-by-email
  host_notification_commands         notify-host-by-fetion,notify-service-by-email
  #       email                           1371@139.com
  pager   1371xx
  9】重启nagios服务




运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-663417-1-1.html 上篇帖子: nagios的错误 下篇帖子: Nagios及其插件的安装配置
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表