1.请安装好Go的环境,参考上一篇open-falcon的安装博文

2.安装 mail-provider

https://github.com/open-falcon/mail-provider

安装方法

cd $GOPATH/src
mkdir github.com/open-falcon/ -p
cd github.com/open-falcon/
git clone https://github.com/open-falcon/mail-provider.git
cd mail-provider
go get ./...
./control build

编译成功之后,修改cfg.json文件相关信息,使用

./control start

在cfg.json里面使用的163邮箱的smtp服务,需要开启客户端授权码,如果提示:发送数量超过配额,请过24小时再请求手机验证码

使用curl命令,验证是否能发邮件,返回success的话就是成功了

curl http://127.0.0.1:4000/sender/mail -d "tos=你的邮箱&subject=报警测试&content=这是一封测试邮件"
success

3.安装 sender

https://github.com/open-falcon-archive/sender

编译和安装

# set $GOPATH and $GOROOT
mkdir -p $GOPATH/src/github.com/open-falcon
cd $GOPATH/src/github.com/open-falcon
git clone https://github.com/open-falcon/sender.git
cd sender
go get ./...
./control build
# vi cfg.json modify configuration
./control start

将cfg.json中的配置改成

 "mail": "http://127.0.0.1:4000/sender/mail"

4.在open-falcon的portal的expression中配置报警表达式,如下图

记住配置报警接受人的组,这决定了谁的邮箱将会收到报警

5.模拟报警环境,然后将会收到邮件,同时在alarm-dashboard中也能看到报警

最新文章

  1. POJ 3009 Curling 2.0【带回溯DFS】
  2. 辛巴学院-Unity-剑英陪你零基础学c#系列(三)计算与类型
  3. JDK在Linux系统上安装教程
  4. Fluent API 配置
  5. RT-Thread多线程导致的临界区问题
  6. [翻译] 使用ASP.NET MVC操作过滤器记录日志
  7. GHOST出错
  8. [转载]java NIO详解
  9. 安卓RadioButton的使用
  10. cocos2d-x中使用JNI的调用JAVA方法
  11. DEV GridView嵌套
  12. Spark-GraphxAPI学习笔记
  13. iOS开发——NSArray中的字典排序
  14. linux_文件类型
  15. Codeforce C. Bus
  16. R语言︱情感分析—词典型代码实践(最基础)(一)
  17. Django项目实践4 - Django站点管理(后台管理员)
  18. C#默认参数原理探究
  19. Elasticsearch-6.7.0系列(三)5601端口 kibana——ES的UI界面
  20. 计算机网络--HTTP协议

热门文章

  1. (转)我是一个java class
  2. 安装vmware 已经配置Centos7
  3. Mac使用Clion配置OpenGL
  4. 命令行添加subl命令
  5. C# Xamarin移动开发基础进修篇
  6. Accounting Calendar template
  7. python测试开发django-51.Ajax发送post请求登录案例
  8. java使用httpclient封装post请求和get的请求
  9. Logical Volume Manager (LVM)
  10. Hadoop的启动和停止说明