服务器探针
本项目为原项目哪吒探针的修改自用版
curl -L https://raw.githubusercontent.com/xos/serverstatus/master/script/server-status.sh -o server-status.sh && chmod +x server-status.sh
sudo ./server-status.sh
curl -L https://fastly.jsdelivr.net/gh/xos/serverstatus@master/script/server-status.sh -o server-status.sh && chmod +x server-status.sh
CN=true sudo ./server-status.sh
* 使用 WatchTower 可以自动更新面板,Windows 终端可以使用 nssm 配置自启动。
注意:
Golang
且版本需要1.18或以上。/opt/server-status/dashboard
。1.克隆仓库
git clone https://github.com/xOS/ServerStatus.git
2.下载依赖
cd ServerStatus/
go mod tidy -v
3.编译,以AMD64
架构为例
cd cmd/dashboard/
CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -o server-dash -ldflags="-s -w"
4.部署面板为系统服务
mkdir -p /opt/server-status/dashboard
mv server-dash /opt/server-status/dashboard/
cd ../..
cp resource/ /opt/server-status/dashboard/ -r
mkdir -p /opt/server-status/dashboard/data
cp script/config.yaml /opt/server-status/dashboard/data
cp script/server-dash.service /etc/systemd/system
5.修改配置文件/opt/server-status/dashboard/data/config.yaml
,注册服务并启动
systemctl enable server-dash
systemctl start server-dash
#NG#
是面板消息占位符,面板触发通知时会自动替换占位符到实际消息
Body 内容是JSON
格式的:当请求类型为 FORM 时,值为 key:value
的形式,value
里面可放置占位符,通知时会自动替换。当请求类型为 JSON 时 只会简进行字符串替换后直接提交到URL
。
URL 里面也可放置占位符,请求时会进行简单的字符串替换。
参考下方的示例,非常灵活。
server 酱示例
https://sc.ftqq.com/SCUrandomkeys.send?text=#NG#
GET
wxpusher 示例,需要关注你的应用
http://wxpusher.zjiecode.com/api/send/message
POST
JSON
{"appToken":"你的appToken","topicIds":[],"content":"#NG#","contentType":"1","uids":["你的uid"]}
telegram 示例 @haitau 贡献
https://api.telegram.org/botXXXXXX/sendMessage?chat_id=YYYYYY&text=#NG#
GET