这篇文章跟大家分享一个轻量级应用Gatus,可用于监控网站运行服务状态,针对运行异常服务进行通知告警。

version: "3"services:gatus:image: twinproduction/gatus:v3.6.0container_name: docker_gatus_composerestart: alwaysvolumes:- home/app/gatus/config:/configrestart: alwaysstop_signal: SIGINTstop_grace_period: 10sports:- 8085:8080
我们本地创建目录/home/app/gatus/config映射Gatus配置目录,8085映射8080端口

#通知alerting:email:from: "from"username: "username"password: "password"host: "host"port: portto: "to"#监控服务endpoints:# 小程序API- name: programApiurl: "https://test.com/"interval: 1800sconditions:- "[STATUS] == 200"alerts:- type: emailenabled: truedescription: "服务掉线了!"send-on-resolved: true
这里我们监控地址https://test.com,间隔是1800秒,如果返回响应是200代表正常,否则代表异常,然后就会发送邮件通知给我。
下面是我的监控详情

具体更多使用大家可以直接访问官网查看
https://github.com/TwiN/gatus
文章转载自程序员技术笔记,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。





