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

 

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

一、安装飞信

cd /root/tools
wget http://ebook.elain.org/tools/fetion20101205.tar.gz

安装步骤略,软件包中有
添加要接收报警短信的手机号为飞信好友

/usr/local/fetion/fetion --mobile=137xxxxxxxx --pwd=1111111 --to=138xxxxxxxx --msg-type=1 --msg-utf8="The Fetion test is ok"

注:第一次要输入验证码,生成验证码后,另开一终端把图片下载下来,打开查看,注意区分大小写!!!

二、vi commands.cfg  添加

define command{
command_name notify-host-by-fetion
command_line /usr/local/fetion/fetion --mobile=137xxxxxxxx --pwd=1111111 --to=138xxxxxxxx --msg-type=1 --msg-utf8="** $NOTIFICATIONTYPE$ Host Alert:$HOSTNAME$ is $HOSTSTATE$ **"
}

define command{
command_name notify-service-by-fetion
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

define contact{
…………
service_notification_commands   notify-service-by-fetion
host_notification_commands      notify-host-by-fetion
…………
}

四、 vi contacts.cfg

define contact {
contact_name                   elain
alias                          sa
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-email,service-notify-by-fetion
host_notification_commands     notify-host-by-email,host-notify-by-fetion
email                          elain2012@hotmail.com
pager                          138xxxxxxxx
}
/etc/init.d/nagios  checkconfig    #检查配置文件 正确性

/etc/nit.d/nagios reload                 #重新加载配置文件

停服务做测试!!!

最新文章

  1. iOS 应用评分
  2. SharePoint 2013 入门教程之创建及修改母版页
  3. 【原】关于使用sklearn进行数据预处理 —— 归一化/标准化/正则化
  4. Winform-DataGridView 实现如Excel的粘贴复制
  5. SQLSERVER执行性能统计工具SQLQueryStress
  6. <转>“人脉投资”的10条建议
  7. Android实现Button事件的处理
  8. CSS之可折叠导航
  9. ASP.NET 使用mode=”InProc”方式保存Session老是丢失,无奈改成StateServer 模式。
  10. C# 语言规范_版本5.0 (第10章 类)
  11. CURL C++网络延时或者最低网速下载设置
  12. centos nginx-1.10.3 安装
  13. ECharts模拟迁徙案例
  14. linkin大话数据结构--Collection和Iterator
  15. MVC思想概述
  16. 不允许lseek文件 | nonseekable_open()【转】
  17. 没有IDE的日子
  18. IBatisNet动态update以及DateTime类型字段处理
  19. 一篇自己都看不懂的CDQ分治&整体二分学习笔记
  20. Word实用教程——五分钟教你如何在任意页开始添加页码

热门文章

  1. limit和offset、切片操作
  2. HTML笔记(三) 表格和列表
  3. 初次shell编程
  4. Python input/output boilerplate for competitive programming
  5. 设计模式:状态模式(Status)
  6. CSUST 2012 一个顶俩 (本校OJ题)(思维+树链剖分)
  7. 简单 UDP 操作类
  8. vue运行碰到的问题
  9. weex 轮播如何使用?
  10. GO语言(golang)官方网站!