CentOS下nagios报警飞信部署四步走

         今天 帮群里一兄弟配了下nagios上的飞信,这个东西 我个人感觉还是很实用的,不过好久没配了,今天配置了一遍,顺便 就把过程记录下来了,供大家学习!!!
一、安装飞信

创新互联专注于宝山网站建设服务及定制,我们拥有丰富的企业做网站经验。 热诚为您提供宝山营销型网站建设,宝山网站制作、宝山网页设计、宝山网站官网定制、重庆小程序开发公司服务,打造宝山网络公司原创品牌,更为您提供宝山网站排名全网营销落地服务。

  1. cd /root/tools 
  2. wget http://ebook.elain.org/tools/fetion20101205.tar.gz 
安装步骤略,软件包中有 添加要接收报警短信的手机号为飞信好友
  1. /usr/local/fetion/fetion --mobile=137xxxxxxxx --pwd=1111111 --to=138xxxxxxxx --msg-type=1 --msg-utf8="The Fetion test is ok"
注:第一次要输入验证码,生成验证码后,另开一终端把图片下载下来,打开查看,注意区分大小写!!! 二、vi commands.cfg  添加
  1. define command{ 
  2. command_name notify-host-by-fetion 
  3. command_line /usr/local/fetion/fetion --mobile=137xxxxxxxx --pwd=1111111 --to=138xxxxxxxx --msg-type=1 --msg-utf8="** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" 
  4.  
  5. define command{ 
  6. command_name notify-service-by-fetion 
  7. command_line /usr/local/fetion/fetion --mobile=137xxxxxxxx --pwd=1111111 --to=138xxxxxxxx --msg-type=1 --msg-utf8="**$NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$ **" 
三、vi templates.cfg
  1. define contact{ 
  2. ………… 
  3. service_notification_commands   notify-service-by-fetion 
  4. host_notification_commands      notify-host-by-fetion 
  5. ………… 

四、 vi contacts.cfg

  1. define contact { 
  2. contact_name                   elain 
  3. alias                          sa 
  4. service_notification_period    24x7 
  5. host_notification_period       24x7 
  6. service_notification_options   w,u,c,r 
  7. host_notification_options      d,u,r 
  8. service_notification_commands  notify-service-by-email,service-notify-by-fetion 
  9. host_notification_commands     notify-host-by-email,host-notify-by-fetion 
  10. email                          elain2012@hotmail.com 
  11. pager                          138xxxxxxxx 


  1. /etc/init.d/nagios  checkconfig    #检查配置文件 正确性 
  2.  
  3. /etc/nit.d/nagios reload                 #重新加载配置文件 


停服务做测试!!!

转载请注明: 转载自http://www.elain.org

本文链接地址:CentOS下nagios报警飞信部署四步走

 

名称栏目:CentOS下nagios报警飞信部署四步走
分享地址:https://www.cdcxhl.com/article24/iipdje.html

成都网站建设公司_创新互联,为您提供移动网站建设网站设计企业建站定制网站品牌网站制作网站排名

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联

成都定制网站网页设计