89d5e27874c200c8815560805b920ce9f405bf1e
* 实现周期采集、快照缓存、本地 HTTP API 和主动上报 * 补齐 Linux 和 Windows 主机、网络、资源、进程和 TCP 采集 * 添加服务生命周期管理、配置加载、构建脚本和测试覆盖 BREAKING CHANGE: network.ips 拆分为 network.ipv4s 和 network.ipv6s。
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.
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
All settings have safe defaults. The HTTP API listens on 127.0.0.1:8080 by default.
{
"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%