zdz / serverstatus-rust Goto Github PK
View Code? Open in Web Editor NEW✨ Rust 版 ServerStatus 探针、威力加强版
Home Page: https://ssr.rs
License: Apache License 2.0
✨ Rust 版 ServerStatus 探针、威力加强版
Home Page: https://ssr.rs
License: Apache License 2.0
[tgbot]
# 开关 true 打开
enabled = true
bot_token = "5688616854:AAHd-dbjLc3Ff3F4ErSYk92SdMqwFPh0ob8"
chat_id = "1342176258"
# host 可用字段参见 payload.rs 文件 HostStat 结构, {{host.xxx}} 为占位变量
# 例如 host.name 可替换为 host.alias,大家根据自己的喜好来编写通知消息
# {{ip_info.query}} 主机 ip, {{sys_info.host_name}} 主机 hostname
title = "❗<b>Server Status</b>"
online_tpl = "{{config.title}} \n😆 {{host.location}} {{host.name}} 主机恢复上线啦"
offline_tpl = "{{config.title}} \n😱 {{host.location}} {{host.name}} 主机已经掉线啦"
# custom 模板置空则停用自定义告警,只保留上下线通知
custom_tpl = """
{% if host.memory_used / host.memory_total > 0.5 %}
<pre>😲 {{host.name}} 主机内存使用率超50%, 当前{{ (100 * host.memory_used / host.memory_total) | round }}% </pre>
{% endif %}
{% if host.hdd_used / host.hdd_total > 0.5 %}
<pre>😲 {{host.name}} 主机硬盘使用率超50%, 当前{{ (100 * host.hdd_used / host.hdd_total) | round }}% </pre>
{% endif %}
"""
Dec 21 17:33:58 GreenCloud.1665472394 systemd[1]: Started ServerStatus-Rust Server. Dec 21 17:33:58 GreenCloud.1665472394 stat_server[1442]: ✨ stat_server v1.6.1 (, 2022-12-21 09:32:12 UTC, rustc 1.66.0) Dec 21 17:33:58 GreenCloud.1665472394 stat_server[1442]: ✨ run in normal mode, load conf from local file `/usr/local/ServerSt> Dec 21 17:33:58 GreenCloud.1665472394 stat_server[1442]: ✨ admin_user: admin Dec 21 17:33:58 GreenCloud.1665472394 stat_server[1442]: ✨ admin_pass: xxxxxx Dec 21 17:33:58 GreenCloud.1665472394 stat_server[1442]: 🚀 listening on http://127.0.0.1:8080 Dec 21 17:33:58 GreenCloud.1665472394 stat_server[1442]: 🚀 listening on grpc://0.0.0.0:9394
我用 #60 里面的测试代码会有一条❗️ServerStatus test msg信息 但是服务器上下线没有
大佬能加个cpu使用率吗,感谢🙏
Sent from PPHub
主控是docker版的最新的,就这几天装的。log文件只存储不清理,几天时间就占了80+g
在客户端执行命令后一会就可以看到客户端信息了
项目地址
https://github.com/Aranxu/NodePanels
https://nodepanels.com/
大佬,现在的版本能够设定自定义标签 labels ,其中 ndd “年月日”可以设定为小鸡的到期时间。
有没有办法通过tg自定义通知设置,来实现在小鸡到期前x天TG提醒,以便于提醒续费?
1、如果可以的话,这个自定义设置应该怎么写?
2、如果现在还不行的话,后期是否有过考虑增加这个功能?
版本:最新 v1.5.7(之前版本也有此问题)
Alpine Linux 上的 Rust 客户端回报的 TCP/UDP 连线数为4294967295
,怀疑是uint
溢出导致的。
这一现象其实在 #18 (comment) 中也有显示:\"tcp\":4294967295,
截图:
Compiling rust takes forever, how about package pre-compile binaries in railway app?
谢谢作者的app,已经布置好了,确实很不错👍
但是有个问题就是手机端显示,请问如何设置才能像桌面那样显示完整?(主要问题想看ping)状态。
我手机端如chrome选了显示桌面版本但是还是没有变化。
谢谢🙏
纯ipv6小鸡,是否能够安装?从实际操作来看,不知道该如何配置才能实现纯ipv6小鸡安装探针,请大佬指点,非常感谢!
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates are currently rate-limited. Click on a checkbox below to force their creation now.
tonic
, tonic-build
)These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
actions/download-artifact
, actions/upload-artifact
)client/Cargo.toml
anyhow 1
bytes 1
chrono 0.4
clap 4.5
fastrand 2.0.1
hyper 1.2
lazy_static 1.4
log 0.4
md5 0.7.0
once_cell 1
pretty_env_logger 0.5
prettytable-rs ^0.10
prost 0.12
regex 1.10
reqwest 0.11
rustls 0.23.5
rustls-pemfile 2
serde 1.0
serde_json 1.0
sysinfo 0.30.7
tokio 1
tokio-rustls 0.26
tonic 0.11
tower 0.4
webpki-roots 0.26
url 2.5.0
chrono 0.4
common/Cargo.toml
bytes 1
prost 0.12
serde 1.0
tonic 0.11
chrono 0.4
tonic-build 0.11
chrono 0.4
protobuf-src 1
tonic-build 0.11
server/Cargo.toml
anyhow 1
axum 0.7.4
axum-extra 0.9.2
bytes 1
chrono 0.4
clap 4.5
futures-util 0.3
hyper 1.2
jsonwebtoken 9.2
lazy_static 1.4
lettre 0.11
log 0.4
md5 0.7.0
minijinja 1.0
mime_guess 2
once_cell 1
pki-types 1
pretty_env_logger 0.5
prettytable-rs ^0.10
prost 0.12
reqwest 0.11
rhai 1.17
rust-embed 8.3
rustls-pemfile 2
serde 1.0
serde_json 1.0
tokio 1
tokio-rustls 0.26
toml 0.8
tonic 0.11
tower-http 0.5
url 2.5.0
uuid 1.7
chrono 0.4
docker-compose.yml
Dockerfile
rust 1.76-alpine3.19
Dockerfile.cloud
.drone.yml
.github/workflows/docker.yml
actions/checkout v4
docker/setup-qemu-action v3
docker/setup-buildx-action v3
docker/login-action v3
docker/build-push-action v5
.github/workflows/release.yml
actions/checkout v3
actions/setup-python v4
PyO3/maturin-action v1
PyO3/maturin-action v1
actions/upload-artifact v3
svenstaro/upx-action v2
actions/upload-artifact v4
TheDoctor0/zip-release 0.7.6
TheDoctor0/zip-release 0.7.6
softprops/action-gh-release v2
actions/checkout v4
PyO3/maturin-action v1
PyO3/maturin-action v1
actions/upload-artifact v3
actions/upload-artifact v3
actions/upload-artifact v3
svenstaro/upx-action v2
actions/upload-artifact v4
TheDoctor0/zip-release 0.7.6
TheDoctor0/zip-release 0.7.6
softprops/action-gh-release v2
actions/checkout v4
actions-rs/toolchain v1
arduino/setup-protoc v1
actions-rs/cargo v1
actions-rs/cargo v1
svenstaro/upx-action v2
actions/upload-artifact v4
TheDoctor0/zip-release 0.7.6
TheDoctor0/zip-release 0.7.6
TheDoctor0/zip-release 0.7.6
TheDoctor0/zip-release 0.7.6
softprops/action-gh-release v2
actions/download-artifact v3
actions/setup-python v4
.github/workflows/rust.yml
actions/checkout v4
actions-rs/toolchain v1
Swatinem/rust-cache v2
web/jinja/detail_ht.jinja.html
zui 1.10.0
zui 1.10.0
zui 1.10.0
web/jinja/map.jinja.html
leaflet 1.9.4
leaflet 1.9.4
client/pyproject.toml
maturin >=1.0,<2.0
server/pyproject.toml
maturin >=1.0,<2.0
服务端只显示IPV6 机器是双栈的 IPV4正常可用
Dec 16 15:38:53 coal-w768p1ep stat_client[2568814]: enable feature native
Dec 16 15:38:56 coal-w768p1ep stat_client[2568814]: get_network (ipv4, ipv6) => (false, false)
Dec 16 15:38:56 coal-w768p1ep stat_client[2568814]: ERROR stat_client > refresh_ip_info error => error sending request for url (http://ip-api.com/json?fields=status,message,continent,continentCode,country,countryCode,region,regionName,city,district,zip,lat,lon,t>
Dec 16 15:38:56 coal-w768p1ep stat_client[2568814]: Caused by:
Dec 16 15:38:56 coal-w768p1ep stat_client[2568814]: 0: connection error: Connection reset by peer (os error 104)
Dec 16 15:38:56 coal-w768p1ep stat_client[2568814]: 1: Connection reset by peer (os error 104)
Dec 16 15:38:59 coal-w768p1ep stat_client[2568814]: ERROR stat_client > refresh_ip_info error => error sending request for url (http://ip-api.com/json?fields=status,message,continent,continentCode,country,countryCode,region,regionName,city,district,zip,lat,lon,t>
Dec 16 15:38:59 coal-w768p1ep stat_client[2568814]: Caused by:
Dec 16 15:38:59 coal-w768p1ep stat_client[2568814]: 0: connection error: Connection reset by peer (os error 104)
Dec 16 15:38:59 coal-w768p1ep stat_client[2568814]: 1: Connection reset by peer (os error 104)
大佬您好,经过学习,已经安装了面板,有个小疑问,我用的是docker版本,面板界面“节点名”显示的是“name”,而登录面板后台,节点名显示的是“alias”展示名,是否可以调整一下?
有一些机器上的流量不是按自然月刷新的,比如在15日刷新并且将 vnstat
的 MonthRotate
也配置为15,那么在15日之前 vnstat --json m
返回的数据会存在不包含当前自然月流量信息的情况,导致 ServerStatus-Rust 显示的月流量为 0.00G | 0.00G.
vnstat json 输出样例 (省略中间部分月份)
{
"vnstatversion": "2.6",
"jsonversion": "2",
"interfaces": [
{
"name": "eth0",
"alias": "",
"created": {
"date": {
"year": 2022,
"month": 3,
"day": 1
}
},
"updated": {
"date": {
"year": 2022,
"month": 11,
"day": 6
},
"time": {
"hour": 6,
"minute": 25
}
},
"traffic": {
"total": {
"rx": 34838225310,
"tx": 537051064160
},
"month": [
{
"id": 1,
"date": {
"year": 2022,
"month": 3
},
"rx": 120663351707,
"tx": 107577662878
},
{
"id": 7,
"date": {
"year": 2022,
"month": 9
},
"rx": 37335903948,
"tx": 23122453659
},
{
"id": 8,
"date": {
"year": 2022,
"month": 10
},
"rx": 21771011198,
"tx": 9919763673
}
]
}
}
]
}
stat_server 版本:
❯ /usr/local/ServerStatus/server/stat_server --version
stat_server v1.5.6 GIT:51f17c7, BUILD:2022-11-02 16:17:06 UTC
stat_client 版本:
❯ /usr/local/ServerStatus/client/stat_client --version
stat_client v1.5.6 GIT:51f17c7, BUILD:2022-11-02 16:17:07 UTC
The current server requires changes the config (and restart) on adding clients, how about adding clients dynamically with preshared passwords?
由于sys id:相同导致上报时数据冲突, 在面板上轮回显示
主机信息警告能否添加显示ip功能?比如能否显示ip(168.****.87)。
online_tpl = "{{config.title}} \n[主机故障] {{host.alias}} ( {{host.ip}} : 主机恢复上线啦"
offline_tpl = "{{config.title}} \n[主机故障] {{host.alias}} ( {{host.ip}} ): 主机已经掉线啦"
最终TG上显示则为:
[主机故障] 墨尔本(134.****.35) : 主机已经掉线啦
[主机故障] 墨尔本(168.****.87) : 主机已经掉线啦
ip 可以不显示整个ip,仅仅显示首和尾,这样比较好区分。特别是在该区有相同的VPS时会比较好方便管理和区分。
hosts配置了一部分机器,hosts_group也配置了一个组,但是只有hsots的机器在现实统计信息,两个不能同时生效吗
我翻阅了参考的链接和直接搜索了这两个参数,没有找到相关的说明
并且我使用 railway 部署遇到了favicon.ico无法部署到 railway 的问题,就是直接访问 网站地址/favicon.ico 时候出现了404,我在index.html里面从新指向到了 img/favicon.ico 后,图标才从新加载出来
服务端布置在国外。国内客户端有部分会屏蔽国外访问。请问 rust 客户端如何设置http代理
目前在客户端掉线后,该主机对应的条目将会隐藏掉所有信息,但有时候机器掉线前的状态对排错很有帮助。是否可以增加一个选项,客户端掉线时仅改变显示方式(比如改变对应行的配色,增加
已有的issues都看了,没看到类似的问题,如有重复,麻烦作者删除此issues
我的配置
❯ vnstat -v
vnStat 2.6 by Teemu Toivola <tst at iki dot fi>
文件 client/src/stat_client.py
if packet_queue.qsize() > 30:
G_LOST_RATE[mark] = float(packet_lost) / packet_queue.qsize()
返回的数据没有去掉小数点后的数字
我改了一下代码
if packet_queue.qsize() > 30:
packet_lost_rate = float(packet_lost) / packet_queue.qsize()
G_LOST_RATE[mark] = round(packet_lost_rate,2)
再次提问希望老大不要生气,虽然您的文档写的很清楚,但是对于小白我来说,还是有的不理解。希望你能耐心解答下
1.#服务端安装:
wget --no-check-certificate -qO status.sh 'https://raw.githubusercontent.com/zdz/ServerStatus-Rust/master/status.sh'
bash status.sh -i -s【服务器IP为X.X.X.X】
2#安装 客户端
wget --no-check-certificate -qO status.sh 'https://raw.githubusercontent.com/zdz/ServerStatus-Rust/master/status.sh'
bash status.sh -i -c
[注意] 请输入服务端的信息, 格式为 "protocol://username:password@master:port"
protocol://h1:[email protected]:8080
不知道这样的输入是否正确。
这里的username对应以下的name ,password 对应以下的password master对应服务段IP port要么是 9394 或者8080
grpc_addr = "0.0.0.0:9394"
http_addr = "0.0.0.0:8080"
hosts = [
{name = "h1", password = "p1", alias = "n1", location = "🏠", type = "kvm", labels = "os=arch;ndd=2022/11/25;spec=2C/4G/60G;"},
{name = "h2", password = "p2", alias = "n2", location = "🏢", type = "kvm", disabled = false},
{name = "h3", password = "p3", alias = "n3", location = "🏡", type = "kvm", monthstart = 1},
{name = "h4", password = "p4", alias = "n4", location = "cn", type = "kvm", notify = true, labels = "ndd=2022/11/25;spec=2C/4G/60G;"},
{name = "mac", password = "pp", alias = "macos"},
{name = "pi", password = "pp", alias = "pi", labels = "os=pi"},
{name = "win", password = "pp", alias = "windows"},
{name = "android", password = "pp", alias = "android", labels = "os=android"},
]
这里的
bash status.sh -i -c grpc://h1:[email protected]:9394
bash status.sh -i -c http://h1:[email protected]:8080
127.0.0.1这个是服务端和客户端在同一台服务器上安装的方式吗
如果服务器和客户端不是同一个机器这里的127.0.0.1是不是需要改成服务端的IP地址
请问一下ping服务器可以成修改指定服务器吗
您好,确实在很多场景都被卡住了无法继续安装测试,但注意到您这句备注“若无法访问 Github:
CN=true bash status.sh args”,但不知是何种解决方式,是脚本直接可以解决吗?请指教
,感谢帮助!
1.7.0的server直接用快速脚本似乎下载了1.7.1的client导致上报数据解析错误.
建议1.7.0和1.7.1之间互相兼容一下.
我看好 Rust 版 ServerStatus,但是服务器有宝塔,通过宝塔部署没教程,完全按教程部署又怕和宝塔的nginx冲突!
求教程,方便菜鸡!
建议加入Bark来推送告警通知。
虽然看到了相关话题还是想问,因为我比较懒 试过在快速部署上追加--cm --ct --cu好像不行
我通过网页F12查看到信息是在不停的推送的,希望可以增加一个时间参数,用来设置间隔多少秒推送一次服务器信息,这个我自己判断是在服务端进行的?不是很确定,希望能增加这样一个功能
nginx
, tg
, wx
, email
配置类问题可以先尝试 google 解决server
与 client
的版本是否适配,启用 vnstat
版本是否 vnstat >= 2.6
stats.json
文件Bug
类 issue
请带上错误日志和版本号(用 -V 参数可以查询到)首先,感谢作者的辛苦付出,这是大伙有目共睹的。目前该探针支持grcp和http与部署在多台的客户端机器进行通信,我想能否添加支持https传输的形式?
Feb 24 01:06:13 winter stat_client[873]: ERROR stat_client > report error => reqwest::Error { kind: Request, url: Url { scheme: "https", cannot_be_a_base: false, 用户名: "", 密码:无,主机:一些(域(“ss.******.xyz”)),端口:无,路径:“/report”,查询:无,片段:无},来源:hyper::Error( Connect, ConnectError("tcp connect error", Os { code: 111, kind: ConnectionRefused, message: "Connection refused" })) }甲骨文云arm,本机安装
服务端和客户端。正常连接,数据正常。查看客户端状态systemctl status stat_client,显示上面的错误,有6条。不知道是怎么回事?谢谢
请问有卸载吗?一键安装怎么卸载,谢谢!
我将其部署在Proxmox也就是PVE上面,似乎监控的流量上下行对等. 这显然是不对的.
我找了下说明似乎没有对自定义网卡监控的说明 ?
大佬 位置不显示国旗图标
rt
尝试在Alpine Linux下运行报错如下:
./stat_client -a "https://host/report" -u user -p pass
[client/src/main.rs:297] &args = Args {
addr: "https://host/report",
user: "user",
pass: "pass",
vnstat: false,
disable_tupd: false,
disable_ping: false,
ct_addr: "ct.tz.cloudcpp.com:80",
cm_addr: "cm.tz.cloudcpp.com:80",
cu_addr: "cu.tz.cloudcpp.com:80",
}
thread 'main' panicked at 'index out of bounds: the len is 0 but the index is 2', client/src/status.rs:187:25
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Aborted
client版本为 1.3.5
相同配置在debian11中正常运行
手机端把协议或者负载去掉,改成位置应该会更好看一些
希望能更灵活部署动态注册组客户端,在客户端用一键安装命令安装的时候自定义location
使用# 下载脚本
wget --no-check-certificate -qO status.sh 'https://raw.githubusercontent.com/zdz/ServerStatus-Rust/master/status.sh'
bash status.sh -i -s 【已经安装IP:168.138.X.X】
bash status.sh -i -c
[注意] 请输入服务端的信息, 格式为 "protocol://username:password@master:port"
protocol://username:[email protected]:8080
请问这里的username:password都对应服务器的什么参数啊
哪里可以设置呢
我的配置文件上,配置了tg的信息,并开启了推送功能,但无法推送!
notify_interval = 30
# https://core.telegram.org/bots/api
# https://jinja.palletsprojects.com/en/3.0.x/templates/#if
[tgbot]
enabled = true
bot_token = "2xxxx67783:AAF4eCz9XMm-TSnI0xxxxxxxx7WYOEAgxqw"
chat_id = "88xxxx680"
# host 可用字段参见 payload.rs 文件 HostStat 结构, {{host.xxx}} 为占位变量
# 例如 host.name 可替换为 host.alias,大家根据喜好来编写通知消息
title = "❗<b>Server Status</b>"
online_tpl = "{{config.title}} \n😆 {{host.location}} {{host.name}} 主机恢复上线啦"
offline_tpl = "{{config.title}} \n😱 {{host.location}} {{host.name}} 主机已经掉线啦"
# custom 模板置空则停用自定义告警,只保留上下线通知
custom_tpl = """
{% if host.memory_used / host.memory_total > 0.5 %}
<pre>😲 {{host.name}} 主机内存使用率超50%, 当前{{ (100 * host.memory_used / host.memory_total) | round }}% </pre>
{% endif %}
{% if host.hdd_used / host.hdd_total > 0.5 %}
<pre>😲 {{host.name}} 主机硬盘使用率超50%, 当前{{ (100 * host.hdd_used / host.hdd_total) | round }}% </pre>
{% endif %}
"""
但我通过 curl 方式区测试是正常的,能否告知我出了什么问题?
curl -X POST \
-H 'Content-Type: application/json' \
-d '{"chat_id": "88xxxx680", "text": "This is a test from curl", "disable_notification": true}' \
https://api.telegram.org/bot2xxxx67783:AAF4eCz9XMm-TSnI0xxxxxxxx7WYOEAgxqw/sendMessage
rt
比如每月
双向 1T 流量.在上下行都用到800G左右 通知一次流量预警信息
单向 500G 流量,在上行/下行最大流量用到300G左右 通知一次流量预警信息
自定义 ping 地址可以任意设置地址吗?可以设置为自己的ip,用域名设置吗?我尝试了一下,设置为当地域名能正确获取,如sc.189.cn:80。但设置为自己的域名就不能正确获取!谢谢
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.