Skip to content

Commit

Permalink
feat: 采集器支持上报系统架构 --story=116223031 (#206)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiandongx authored Feb 23, 2024
1 parent b6b34f8 commit 4cd08b6
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pkg/bkmonitorbeat/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v3.27.x
v3.28.x
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ EOF
check_disk_space_interval: 60
check_oom_interval: 10
used_max_disk_space_percent: 95
free_min_disk_space: 10
EOF
cat <<EOF >> "$path"
# 进程采集:同步 CMDB 进程配置文件到 bkmonitorbeat 子任务文件夹下
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ bkmonitorbeat:
check_disk_space_interval: 60
check_oom_interval: 10
used_max_disk_space_percent: 95

free_min_disk_space: 10
# 进程采集:同步 CMDB 进程配置文件到 bkmonitorbeat 子任务文件夹下
procconf_task:
task_id: 103
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ bkmonitorbeat:
check_disk_space_interval: 60
check_oom_interval: 10
used_max_disk_space_percent: 95

free_min_disk_space: 10
# 进程采集:同步 CMDB 进程配置文件到 bkmonitorbeat 子任务文件夹下
procconf_task:
task_id: 103
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ bkmonitorbeat:
check_disk_space_interval: 60
check_oom_interval: 10
used_max_disk_space_percent: 95

free_min_disk_space: 10
# 进程采集:同步 CMDB 进程配置文件到 bkmonitorbeat 子任务文件夹下
procconf_task:
task_id: 103
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ bkmonitorbeat:
check_disk_space_interval: 60
check_oom_interval: 10
used_max_disk_space_percent: 95

free_min_disk_space: 10
# 进程采集:同步 CMDB 进程配置文件到 bkmonitorbeat 子任务文件夹下
procconf_task:
task_id: 103
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ bkmonitorbeat:
check_disk_space_interval: 60
check_oom_interval: 10
used_max_disk_space_percent: 95

free_min_disk_space: 10
# 进程采集:同步 CMDB 进程配置文件到 bkmonitorbeat 子任务文件夹下
procconf_task:
task_id: 103
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ bkmonitorbeat:
check_disk_space_interval: 60
check_oom_interval: 10
used_max_disk_space_percent: 95

free_min_disk_space: 10
# 进程采集:同步 CMDB 进程配置文件到 bkmonitorbeat 子任务文件夹下
procconf_task:
task_id: 103
Expand Down
8 changes: 8 additions & 0 deletions pkg/bkmonitorbeat/tasks/static/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,16 @@ func (r *Report) AsMapStr() common.MapStr {
}
}

arch := "x86"
if r.System.Arch == "arm" || r.System.Arch == "aarch64" {
arch = "arm"
}

if r.System != nil {
result["system"] = common.MapStr{
"hostname": r.System.HostName,
"os": r.System.OS,
"arch": arch,
"platform": r.System.Platform,
"platVer": r.System.PlatVer,
"sysType": r.System.SysType,
Expand Down Expand Up @@ -131,6 +137,7 @@ type System struct {
PlatVer string
SysType string
BKAgentID string
Arch string
}

// GetData 采集全部静态数据
Expand Down Expand Up @@ -266,6 +273,7 @@ var GetSystemStatus = func(ctx context.Context) (*System, error) {
Platform: info.Platform,
PlatVer: info.PlatformVersion,
BKAgentID: bkAgentID,
Arch: info.KernelArch,
}, nil
}

Expand Down

0 comments on commit 4cd08b6

Please sign in to comment.