IsTheServerUp
为你的选择的上游监控器暴露各个后端服务器的健康状态。
IsTheServerUp 是一个 Velocity 插件,适用于 Uptime Kuma 和 Gatus 等上游监控器,以回答自古以来你的朋友就问过的问题:“服务器还活着吗?”
本插件基于 Velocity 3.5.0-SNAPSHOT 编译,需要 Java 21+。
功能
- 通过你的 Velocity 代理轻松暴露各个后端的健康状态——如果 Velocity 能访问你的服务器,玩家也能访问。
- 使用你自己的上游监控器轮询
/health/{backend_name} 端点以获取在线状态。
- 简单、轻量,且零额外依赖(当然除了 Velocity)。
这个插件能帮我什么?
saya: “elaina 小姐,Minecraft 服务器上线了吗?”
elaina: “去查一下上游监控器,它在 uptime.unitedmagic.org”
saya: “但我想听你亲口说”
elaina: “承蒙厚爱,但你真的应该直接查看状态页面”
saya: “但是 elaina 小姐,我爱你爱到不想从别人那里听到答案”
elaina: “嗯……好吧,祝你愉快,saya”
saya: “等等,elaina 小姐请等一下!我需要知道服务器是否在线”
elaina: “不”
saya: “‘不’是指你不想告诉我,还是指服务器没上线”
elaina: “不”
如何使用?
- 将此插件安装到 Velocity 代理的
plugins/ 文件夹中。
- (重新) 启动 Velocity 让插件自动生成配置文件,然后停止 Velocity。
- 根据需要编辑配置文件,然后启动 Velocity。
- 将你选择的监控器指向后端端点。如果是
200,则表示在线。如果是 503,则表示离线。
- 完成。
如果你想使用 TLS,你应该使用适当的反向代理(如 NGINX 或 Caddy)来前置 Web 服务器。
Caddy 和 Gatus 示例

以下是我用于朋友团队的 Velocity 网络的代码片段。IsTheServerUp 运行在 Velocity 上,其 HTTP 服务器通过 Caddy 进行代理。Gatus 是我的上游监控器,通过 Caddy 轮询 IsTheServerUp。
我在与 Velocity 代理相同的机器上运行 Caddy。我使用它来反向代理绑定到 localhost 的 IsTheServerUp Web 服务器。Caddy 的配置如下:
metrics.unitedmagic.org:80 {
handle_path /velocity* {
reverse_proxy http://127.0.0.1:8080
}
}
我通过 VPN 隧道在另一台机器上使用 Gatus 来监控这些端点。以下是我的 Gatus 配置中与本插件相关的片段:
endpoints:
- name: UMA SMP
group: Minecraft Servers
url: "http://metrics.unitedmagic.org/velocity/health/smp"
interval: 60s
conditions:
- "[STATUS] == 200"
- name: UMA Skyblock
group: Minecraft Servers
url: "http://metrics.unitedmagic.org/velocity/health/skyblock"
interval: 60s
conditions:
- "[STATUS] == 200"
配置
本插件使用 HOCON 配置文件。你可以在下面找到默认生成的配置。
# Web 服务器绑定的 IP 地址。
bind-address="127.0.0.1"
# Web 服务器绑定的端口。
bind-port=8080
# 停止 Web 服务器时等待活跃请求完成的超时时间(秒)。
webserver-shutdown-delay-seconds=5
# 随响应发送的 HTTP Content-Type 头值。
response-content-type="text/plain; charset=utf-8"
# 当后端服务器在线时返回的正文文本。
response-up-text="UP\n"
# 当后端服务器离线或无法访问时返回的正文文本。
response-down-text="DOWN\n"
# 缓存后端状态结果的时间(毫秒),以防止因频繁 ping 后端服务器而对其造成压力。
ping-cache-duration-ms=1000
# 等待后端服务器响应 ping 前的超时时间(毫秒)。
ping-timeout-ms=1000
许可证
除非另有说明,本仓库中的所有源代码均在 Mozilla Public License 2.0 (SPDX: MPL-2.0) 许可下提供。请查看 LICENSE 文件以了解 MPL-2.0 下的条款。
IsTheServerUp
Expose the health status of individual backend servers for the uptime monitor of your choice.
IsTheServerUp is a Velocity plugin for uptime monitors like Uptime Kuma and Gatus to answer the question asked by your friends since time immemorial: "Is the server up?"
This plugin was compiled against Velocity 3.5.0-SNAPSHOT and requires Java 21+.
Features
- Easily expose your individual backends' health status through your Velocity proxy - if Velocity can reach your server, your players can reach it.
- Bring your own uptime monitor to poll
/health/{backend_name} endpoints for uptime.
- Simple, lightweight, and zero extra dependencies (other than Velocity of course).
How can this plugin help me?
saya: "miss elaina, is the Minecraft server up yet?"
elaina: "check the uptime monitor it's at uptime.unitedmagic.org"
saya: "but i want to hear it from you"
elaina: "i'm flattered but you should really just check the status page"
saya: "but miss elaina i love you so much that i don't want to hear it from anyone else"
elaina: "riiiight okay then well have a good one, saya"
saya: "wait miss elaina please wait! i need to know if the server is up"
elaina: "no"
saya: "no as in you don't want to tell me or no as in the server is not up"
elaina: "no"
How do I use it?
- Install this plugin into your Velocity proxy's
plugins/ folder.
- (Re)start Velocity to let the plugin autopopulate the config, then stop Velocity.
- Edit the configuration to your liking then start Velocity.
- Point the uptime checker of your choice at the backend endpoint. If it's
200, it's up. If it's 503, it's not.
- Done.
If you want to use TLS, you should front the webserver with a proper reverse proxy like NGINX or Caddy.
Caddy and Gatus example

Below are snippets that I use for my friend group's Velocity network. IsTheServerUp is running on Velocity with its HTTP server proxied behind Caddy. Gatus is my uptime monitor polling IsTheServerUp through Caddy.
I am running Caddy on the same machine as my Velocity proxy. I am using it to reverse proxy my localhost-bound IsTheServerUp web server. The config for Caddy is below:
metrics.unitedmagic.org:80 {
handle_path /velocity* {
reverse_proxy http://127.0.0.1:8080
}
}
I use Gatus on another machine through a VPN tunnel to monitor the endpoints. Here is a snippet of my Gatus configuration relevant to this plugin:
endpoints:
- name: UMA SMP
group: Minecraft Servers
url: "http://metrics.unitedmagic.org/velocity/health/smp"
interval: 60s
conditions:
- "[STATUS] == 200"
- name: UMA Skyblock
group: Minecraft Servers
url: "http://metrics.unitedmagic.org/velocity/health/skyblock"
interval: 60s
conditions:
- "[STATUS] == 200"
Configuration
This plugin uses a HOCON configuration file. You can find the default generated configuration below.
# The IP the web server will bind to.
bind-address="127.0.0.1"
# The port the web server will bind to.
bind-port=8080
# Maximum time (in seconds) to wait for active requests to finish when stopping the web server.
webserver-shutdown-delay-seconds=5
# The HTTP Content-Type header value sent with the response.
response-content-type="text/plain; charset=utf-8"
# The body text returned when the backend server is online.
response-up-text="UP\n"
# The body text returned when the backend server is offline or unreachable.
response-down-text="DOWN\n"
# Time (in milliseconds) to cache backend status results to prevent hammering backend servers with pings.
ping-cache-duration-ms=1000
# How long to wait (in milliseconds) for a backend server to respond to a ping before timing out.
ping-timeout-ms=1000
License
Unless otherwise noted, all source code in this repository is licensed under the Mozilla Public License 2.0 (SPDX: MPL-2.0). Please view the LICENSE file for the terms you are afforded under the MPL-2.0.
评论 0
登录后参与评分
还没有评论,来抢沙发吧