877e4cf41da0020845e23536f3579b051ce97015
将代码与测试注释改为中文以符合仓库规范;新增中文部署指南、 示例配置,并完善构建脚本对 VERSION 注入的说明。 Co-authored-by: Cursor <cursoragent@cursor.com>
MFD Monitor Agent
Single-binary host status agent implemented in Go.
Features
GET /healthreturns process liveness and latest snapshot metadata.GET /statusreturns the cached full host snapshot.- Periodic background collection keeps HTTP responses fast.
- Optional periodic HTTP POST reporting reuses the same
HostStatusJSON. - Linux collectors read host, network, CPU, memory, disk, process, and TCP listener data from the OS.
- Windows and Linux service lifecycle commands are exposed through the CLI.
完整部署说明(中文): docs/DEPLOYMENT.md
Commands
agent run [-config config.json]
agent install [-config config.json] [-exe /path/to/agent]
agent uninstall [-config config.json]
agent start [-config config.json]
agent stop [-config config.json]
agent version
Build
Linux:
./scripts/build-linux.sh
Windows PowerShell:
.\scripts\build-windows.ps1
Cross-compile Windows from Linux:
GOOS_TARGET=windows GOARCH_TARGET=amd64 OUTPUT_NAME=agent-windows-amd64.exe ./scripts/build-linux.sh
Build outputs are written to dist/, which is intentionally ignored by Git.
Configuration
Example config: configs/example.json. See docs/DEPLOYMENT.md for defaults, environment variables, and production deployment steps.
{
"host_id": "host-a",
"http": {
"listen_address": "127.0.0.1:8080"
},
"collect": {
"interval": "30s",
"timeout": "10s"
},
"report": {
"enabled": true,
"endpoint": "http://center.example.internal/agent/status",
"interval": "60s",
"timeout": "5s"
}
}
Environment overrides:
MFD_AGENT_HOST_IDMFD_AGENT_LISTENMFD_AGENT_COLLECT_INTERVALMFD_AGENT_COLLECT_TIMEOUTMFD_AGENT_REPORT_ENABLEDMFD_AGENT_REPORT_ENDPOINTMFD_AGENT_REPORT_INTERVALMFD_AGENT_REPORT_TIMEOUT
Description
Languages
Go
97%
Shell
1.8%
PowerShell
1.2%