工具介绍
EaseProbe可以做三种工作:探测、通知和报告。
项目地址:https://github.com/megaease/easeprobe
1、安装
[root@localhost ]# yum -y install unzip go
[root@localhost ]# unzip easeprobe-main.zip
[root@localhost ]# cd easeprobe-main
[root@localhost easeprobe-main]# make
github.com/megaease/easeprobe/notify/aws tested bygithub.com/megaease/easeprobe/notify/aws.test importsgithub.com/aws/aws-sdk-go/aws/request: github.com/aws/aws-sdk-go@v1.44.294: Get "https://proxy.golang.org/github.com/aws/aws-sdk-go/@v/v1.44.294.zip": dial tcp 172.217.163.49:443: i/o timeout
make: *** [/opt/meepo/easeprobe-main//build/bin/easeprobe] Error 1[root@localhost easeprobe-main]# go env -w GOPROXY=https://goproxy.io,direct
[root@localhost easeprobe-main]# make
2、配置使用
PS:下面列举出各个模块的配置,可以自己测试验证效果
[root@localhost easeprobe-main]# vim resources/config.yaml
# --------------------- HTTP Probe Configuration
http: # http probes- name: My Blogurl: http://www.aihuidi.com
# -------------------- TCP Probe Configuration
tcp:- name: Webhost: 192.168.200.180:22
# --------------------- SSH Probe Configuration
ssh:servers:- name : Web nodehost: 192.168.200.149:22username: rootpassword: passwordcmd: "ps aux | grep nginx"
# --------------------- TLS Probe Configuration
tls:- name: Official websitehost: www.aihuidi.com:443insecure_skip_verify: trueexpire_skip_verify: falsealert_expire_before: 168h
# --------------------- Notification Configuration
notify:log:- name: log file # local log filefile: /var/log/easeprobe.logemail:- name: "DevOps Mailing List"server: smtp.163.com:25username: xxxxpassword: xxxxto: "发送给谁的邮箱"
# --------------------- Global Settings Configuration
settings:probe:timeout: 30s # the time out for all probes 探测超时设置interval: 1m # probe every minute for all probes 探测时间间隔默认1分钟alert:strategy: regularfactor: 1max: 3
3、启动
[root@localhost easeprobe-main]# pwd
/opt/meepo/easeprobe-main
[root@localhost easeprobe-main]# build/bin/easeprobe -f ./resources/config.yaml
Web SLA http://192.168.200.183:8181/
JSON
http://192.168.200.183:8181/api/v1/sla
4、后台运行
[root@localhost easeprobe-main]# nohup build/bin/easeprobe -f ./resources/config.yaml &
5、邮件告警