From dd6a5ec3f121f68b74430a4b5a0eac8e02de73f8 Mon Sep 17 00:00:00 2001 From: Aldo Sotolongo Date: Wed, 28 Sep 2016 08:54:23 -0400 Subject: [PATCH] Adding device to FSInfo. --- main.go | 3 ++- stats.go | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 80d8d78..2250576 100644 --- a/main.go +++ b/main.go @@ -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, diff --git a/stats.go b/stats.go index 1a353ab..4126f86 100644 --- a/stats.go +++ b/stats.go @@ -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 @@ -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, }) } }