Skip to content

Commit

Permalink
fix(dbm-services): 忽略采集windows主机的空磁盘 #6800
Browse files Browse the repository at this point in the history
  • Loading branch information
ymakedaq committed Sep 10, 2024
1 parent c94e463 commit b283b4a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dbm-services/common/db-resource/internal/svr/bk/disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func GetDiskInfo(hosts []IPList, bk_biz_id int, hostOsMap map[string]string) (re
maps.Copy(ipFailedLogMap, ipFailedLogMapWin)
for _, d := range ipLogs.ScriptTaskLogs {
var dl PowerShellResCollection
jsonBody := jsonRe.FindString(d.LogContent)
jsonBody := d.LogContent
logger.Info("%s shell grab json body: %s", d.Ip, jsonBody)
if err = json.Unmarshal([]byte(jsonBody), &dl); err != nil {
logger.Error("unmarshal log content failed %s", err.Error())
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$diskInfo = Get-WmiObject -Class Win32_LogicalDisk -Filter "DriveType=3" | ForEach-Object {
$diskInfo = Get-WmiObject -Class Win32_LogicalDisk -Filter "DriveType=3" | Where-Object { $_.FreeSpace -lt $_.Size } | ForEach-Object {
[PSCustomObject]@{
DriveLetter = $_.DeviceID
TotalSize = $_.Size
Expand Down

0 comments on commit b283b4a

Please sign in to comment.