From d296b781ac8973080bcb8915ade9663ce1895e48 Mon Sep 17 00:00:00 2001 From: dushixiang Date: Sat, 6 Dec 2025 18:48:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DWindows=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E4=B8=8B=E7=A3=81=E7=9B=98=E9=87=87=E9=9B=86=E7=9A=84=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/agent/agent.example.yaml | 2 +- pkg/agent/config/config.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/agent/agent.example.yaml b/cmd/agent/agent.example.yaml index 989ddb4..d716b6c 100644 --- a/cmd/agent/agent.example.yaml +++ b/cmd/agent/agent.example.yaml @@ -50,7 +50,7 @@ collector: # 如果为空,默认采集系统主分区(Linux/macOS: "/",Windows: "C:\") # 例如: # Linux/macOS: ["/", "/data", "/home"] - # Windows: ["C:\\", "D:\\"] + # Windows: ["C:", "D:"] disk_include: - "/" # 只采集根分区 diff --git a/pkg/agent/config/config.go b/pkg/agent/config/config.go index bf175c4..b919356 100644 --- a/pkg/agent/config/config.go +++ b/pkg/agent/config/config.go @@ -70,7 +70,7 @@ type CollectorConfig struct { // 如果为空,默认采集系统主分区(Linux/macOS: "/",Windows: "C:\") // 例如: // Linux/macOS: ["/", "/data", "/home"] - // Windows: ["C:\\", "D:\\"] + // Windows: ["C:", "D:"] DiskInclude []string `yaml:"disk_include"` } @@ -372,11 +372,11 @@ func (c *Config) ShouldExcludeNetworkInterface(interfaceName string) bool { // GetDiskInclude 获取磁盘包含的挂载点列表(白名单) // 如果配置为空,返回默认的根分区匹配规则 // Linux/macOS: ["/"] -// Windows: ["C:\\"] +// Windows: ["C:"] func (c *Config) GetDiskInclude() []string { if len(c.Collector.DiskInclude) == 0 { if runtime.GOOS == "windows" { - return []string{"C:\\"} + return []string{"C:"} } return []string{"/"} }