Skip to content

Commit

Permalink
fixed linux mem invalid value. #108 (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
fatevase authored Apr 5, 2024
1 parent ff69bd3 commit 7aa5548
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion memorycheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func (task *MemoryCheckTask) checkMemory() {
if runtime.GOOS == "windows" {
cmd = exec.Command("wmic", "OS", "get", "FreePhysicalMemory", "/Value")
} else {
cmd = exec.Command("sh", "-c", "free | grep Mem | awk '{print $3/$2 * 100.0}'")
cmd = exec.Command("sh", "-c", "free | awk 'NR==2{print $3/$2 * 100.0}'")
}

var out bytes.Buffer
Expand Down

0 comments on commit 7aa5548

Please sign in to comment.