Gatus - 自动化监控网站运行服务 监控软件 docker


https://hub.docker.com/r/twinproduction/gatus

https://github.com/TwiN/gatus

https://gatus.io/


docker run -d  -p 8080:8080  --name gatus  --restart=always  -v /etc/localtime:/etc/localtime:ro  -v  /data/docker/monitor/gatus/config:/config   -v /data/docker/monitor/gatus/data:/data/

twinproduction/gatus:latest


http://b.htmltoo.com:8080


config/config.yaml

---type: sqlite

storage:
  type: sqlite
  path: /data/data.db
alerting:
  email:
    from: "522588122@qq.com"
    username: "522588122@qq.com"
    password: "wodptbpkwuwobhjj"
    host: "ssl://smtp.qq.com"
    port: 465
    to: "522588122@qq.com"
    overrides:
      - group: "site"
        to: "13850000249@qq.com,13850000249@qq.com"
endpoints:
  - name: htmltoo.www
    group: site
    url: "https://www.htmltoo.com/health.txt"
    interval: 5m
    conditions:
      - "[STATUS] == 200"
      - "[BODY].status == UP"
      - "[RESPONSE_TIME] < 300" 
      - "[CERTIFICATE_EXPIRATION] > 96h"
    alerts:
      - type: email
        enabled: true
        description: "healthcheck failed"
        send-on-resolved: true
  - name: domsn.www
    url: "https://www.domsn.com/health.txt"
    interval: 5m
    conditions:
      - "[STATUS] == 200"
      - "[BODY].status == UP"
      - "[RESPONSE_TIME] < 300" 
      - "[CERTIFICATE_EXPIRATION] > 96h"
    alerts:
      - type: email
        enabled: true
        description: "healthcheck failed"
        send-on-resolved: true
  - name: ecdoo.www
    url: "https://www.ecdoo.com/health.txt"
    interval: 5m
    conditions:
      - "[STATUS] == 200"
      - "[BODY].status == UP"
      - "[RESPONSE_TIME] < 300" 
      - "[CERTIFICATE_EXPIRATION] > 96h"
    alerts:
      - type: email
        enabled: true
        description: "healthcheck failed"
        send-on-resolved: true

---type: postgres

storage:
  type: postgres
  path: "postgres://gatus:gatus@postgres:5432/gatus?sslmode=disable"
endpoints:
  - name: ywbj.cc
    group: ywbj
    url: "https://ywbj.cc"
    interval: 60s
    conditions:
      - "[STATUS] == 200"
      - "[RESPONSE_TIME] < 500"
simple example:
endpoints:
  - name: website                 # Name of your endpoint, can be anything
    url: "https://twin.sh/health"
    interval: 5m                  # Duration to wait between every status check (default: 60s)
    conditions:
      - "[STATUS] == 200"         # Status must be 200
      - "[BODY].status == UP"     # The json path "$.status" must be equal to UP
      - "[RESPONSE_TIME] < 300"   # Response time must be under 300ms
  - name: example
    url: "https://example.org/"
    interval: 60s
    conditions:
      - "[STATUS] == 200"
storage:
  type: postgres
  path: "postgres://username:password@postgres:5432/gatus?sslmode=disable"
endpoints:
  - name: back-end
    group: core
    url: "https://example.org/"
    interval: 5m
    conditions:
      - "[STATUS] == 200"
      - "[CERTIFICATE_EXPIRATION] > 48h"
  - name: monitoring
    group: internal
    url: "https://example.org/"
    interval: 5m
    conditions:
      - "[STATUS] == 200"
  - name: nas
    group: internal
    url: "https://example.org/"
    interval: 5m
    conditions:
      - "[STATUS] == 200"
  - name: example-dns-query
    url: "8.8.8.8" # Address of the DNS server to use
    interval: 5m
    dns:
      query-name: "example.com"
      query-type: "A"
    conditions:
      - "[BODY] == 93.184.216.34"
      - "[DNS_RCODE] == NOERROR"
  - name: icmp-ping
    url: "icmp://example.org"
    interval: 1m
    conditions:
      - "[CONNECTED] == true"

---TCP

endpoints:
  - name: redis
    url: "tcp://127.0.0.1:6379"
    interval: 30s
    conditions:
      - "[CONNECTED] == true"


---https://www.htmltoo.com/health.txt

{"status":"UP"}

"[BODY].status == UP"


Gatus 提供一个轻量级的监控健康,让开发者通过服务的简单 HTTP、ICMP 等协议来监控情况,并根据网页监控 TCP 的状态码或响应时间及正文来决定网站是否健康,如果发生了异常,可以设置不同的 Alert 像是 Slack、Email、Teams、 Discord这个链接查看Dashboard 实际情况。它是Go语言写出来的,非常轻量。


签名:这个人很懒,什么也没有留下!
最新回复 (0)
返回