Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,8 @@ Memory:
if len(stats.FSInfos) > 0 {
fmt.Println("Filesystems:")
for _, fs := range stats.FSInfos {
fmt.Fprintf(output, " %s%8s%s: %s%s%s free of %s%s%s\n",
fmt.Fprintf(output, "%s%28s%s %s%8s%s: %s%s%s free of %s%s%s\n",
escBrightWhite, fs.Device, escReset,
escBrightWhite, fs.MountPoint, escReset,
escBrightWhite, fmtBytes(fs.Free), escReset,
escBrightWhite, fmtBytes(fs.Used+fs.Free), escReset,
Expand Down
8 changes: 5 additions & 3 deletions stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ package main

import (
"bufio"
"golang.org/x/crypto/ssh"
"strconv"
"strings"
"time"

"golang.org/x/crypto/ssh"
)

type FSInfo struct {
Device string
MountPoint string
Used uint64
Free uint64
Expand Down Expand Up @@ -189,7 +191,7 @@ func getMemInfo(client *ssh.Client, stats *Stats) (err error) {
}

func getFSInfo(client *ssh.Client, stats *Stats) (err error) {
lines, err := runCommand(client, "/bin/df -B1")
lines, err := runCommand(client, "/bin/df -PB1")
if err != nil {
return
}
Expand All @@ -215,7 +217,7 @@ func getFSInfo(client *ssh.Client, stats *Stats) (err error) {
continue
}
stats.FSInfos = append(stats.FSInfos, FSInfo{
parts[5-i], used, free,
parts[0], parts[5-i], used, free,
})
}
}
Expand Down