工具介绍
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 by
github.com/megaease/easeprobe/notify/aws.test imports
github.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 Blog
url: http://www.aihuidi.com
# -------------------- TCP Probe Configuration
tcp:
- name: Web
host: 192.168.200.180:22
# --------------------- SSH Probe Configuration
ssh:
servers:
- name : Web node
host: 192.168.200.149:22
username: root
password: password
cmd: "ps aux | grep nginx"
# --------------------- TLS Probe Configuration
tls:
- name: Official website
host: www.aihuidi.com:443
insecure_skip_verify: true
expire_skip_verify: false
alert_expire_before: 168h
# --------------------- Notification Configuration
notify:
log:
- name: log file # local log file
file: /var/log/easeprobe.log
email:
- name: "DevOps Mailing List"
server: smtp.163.com:25
username: xxxx
password: xxxx
to: "发送给谁的邮箱"
# --------------------- Global Settings Configuration
settings:
probe:
timeout: 30s # the time out for all probes 探测超时设置
interval: 1m # probe every minute for all probes 探测时间间隔默认1分钟
alert:
strategy: regular
factor: 1
max: 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、邮件告警