(封面图源Gatus主页 )
TL;DR 在建家里云的时候,难免会出现一些问题,比如没法实时知道某个服务是否可用,这个时候就需要一个健康度检查面板了。
这是项目官方的仓库 。
安装 官方提供了docker的安装方式,但其实是可以直接编译安装的,它编译出来就是一个单独的二进制文件,直接运行就行了。
⚠️注意: 请确保你机器上安装了go。
首先克隆官方仓库:
1 git clone --depth=1 https://github.com/TwiN/gatus.git
然后直接开始编译:
1 2 3 4 5 export GOARCH=amd64 go build -o "$(basename `pwd`)-${GOOS}-${GOARCH}"# 也可以交叉编译arm版的,这样可以兼容410棒子 export GOARCH=arm64 go build -o "$(basename `pwd`)-${GOOS}-${GOARCH}"
然后就会在项目根目录里生成一个二进制文件。
运行和配置 要运行的话,得先设置一个环境变量。当然也可以用我的这个脚本来运行:
1 2 export GATUS_CONFIG_PATH=$(pwd)/config.yaml ./gatus-linux-amd64
接下来就是配置了,直接贴我的配置文件吧:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 web: address: 0.0 .0 .0 port: 9999 ui: title: "家里云 Status" description: "See what's running" dashboard-heading: "Health Dashboard" dashboard-subheading: "Monitor the health of your endpoints in real-time" header: "家里云 Status" logo: "http://192.168.1.1010:1080/cxk.svg" link: "http://192.168.1.1010:1080" dark-mode: true default-sort-by: "group" default-filter-by: "" custom-css: ".w-12.h-12.flex.items-center.justify-center{transition: transform 0.5s ease;} .w-12.h-12.flex.items-center.justify-center:hover{transform: rotate(1800deg);} .bg-background.text-foreground{background-image: url('https://source.unsplash.com/random');background-size: cover;background-position: center;background-attachment: fixed;min-height: 100vh;position: relative;} .dashboard-container.bg-background,.rounded-lg.border,.bg-card.border-b,.past-announcements{background-color: rgba(255, 255, 255, 0.2);backdrop-filter: blur(10px);-webkit-backdrop-filter: blur(10px)}" buttons: - name: "Follow on 𝕏" link: "https://x.com/realdonaldtrump" endpoints: - name: Alist group: 家里云 url: "http://192.168.1.105:5244" interval: 5m alerts: - type: slack description: "healthcheck failed" send-on-resolved: true conditions: - "[STATUS] == 200" - name: Calibre-Web group: 家里云 url: "http://192.168.1.106:8083" interval: 5m alerts: - type: slack description: "healthcheck failed" send-on-resolved: true conditions: - "[STATUS] == 200" - name: wine-noVNC group: 家里云 url: "http://192.168.1.102:5999" interval: 5m alerts: - type: slack description: "healthcheck failed" send-on-resolved: true conditions: - "[STATUS] == 200"