Skip to content

Adding device to FSInfo. #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
6 changes: 4 additions & 2 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 @@ -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