SimpleHealthcheck
A lightweight Valheim server mod to call webhooks and support simple health monitoring via HTTP.
模組介紹 作者原文
Valheim Server Simple HealthCheck
A lightweight Valheim server mod to call webhooks and support simple health monitoring via HTTP.
Features
The goal of this mod is to provide some simple server monitoring tools with low overhead and not bring in a whole bunch of other dependencies. While other server notification mods are usually tightly coupled with a specific service (e.g. a discord event notifier), this mod supports calling any arbitrary webhook you provide when certain events happen on the server. For example, when a player joins my server, this mod calls an IFTTT webhook to start a routine that sends a discord notification to two different discord servers, and triggers a blink(1) device.
See the configuration section for more information. Please submit any suggestions for more events to support as an issue.
This mod also creates a lightweight webserver that allows external uptime monitoring tools (e.g. UptimeRobot) to monitor the status of your Valheim server by responding to incoming HTTP requests. As with the webhooks, there are other solutions out there,
but they often work by parsing server logs and require starting up a node.js instance or other beefier infrastructure.
The web server will respond to HEAD and GET method requests only. You can also specify a keyword to send in the response body to facilitate keyword monitoring, if desired (and supported by your monitoring service).
See the Confgiuration section for more customization info.
The simplest way to use the webserver is to run the mod with your Valheim server, then point a reverse proxy to it on the same machine.
Configuration
WebHooks
This section of the config file contains settings that allow you to set a URL that the plugin will call when some event happens.
By default the plugin sends a GET request, but this can be changed by prefixing the URL with an HTTP method
seperated from the URL with a;. Supported methods are: GET, HEAD, PUT, POST, and DELETE.
If an invalid or no method is specified, GET will be used.
For example, to specify a POST request:
ServerStarted = POST;
Additionally, some webhooks support substituting occurrences of a special string with a value coming from the plugin. This allows you
to pass some data along about the event. Substitutions specific to a hook will be noted in the entry in config file.
All hooks support the substitution {HookName}, which is replaced with the name of the entry in the config file.
For example, in the following URL the string {PlayerName} will be replaced by the name of the player who joined the server,
and {HookName} will be replaced with "PlayerJoined":
PlayerJoined = GET;
See the config file for documentation about each webhook.
Heartbeat
A heartbeat is just a special webhook that is called at a regular interval to indicate that the server is still running. You can specify the heartbeat URL as well as the interval in the config file.
WebServer
- EnableWebServer
- Default: true
- If the webserver should be enabled and respond to external requests or not.
- HttpHost
- Default: localhost
- The HTTP host or address to bind to.
- HttpPort
- Default: 5080
- The HTTP port to use.
- ResponseKeyword
- Default: VALHEIM_SERVER
- A keyword to return in GET requests to service keyword based monitoring.
- SuccessCode
- Default: 200
- The HTTP status code to respond with to indicate server is running.
Installation
BepinEx for Valheim is required for this plugin to work.
Install from your favorite mod manager, or manually by following these instructions:
- Download and extract the build artifact for the latest release
- Place the bbar.Mods.SimpleHealthCheck.dll file into \Bepinex\plugins
- The first time the game starts with the plugin loaded, it will generate a config file: \BepinEx\config\bbar.Mods.SimpleHealthCheck.cfg
- Open the cfg file to change configuration as needed. Any manual changes to th
安裝與使用 安裝:BepInEx 外掛
- 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
- 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
- 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
- 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。
帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。 多人連線時,主機與所有用戶端需要安裝一致的模組。
下面這些內容需要先安裝,否則該模組不會生效: