From bba162c55b864aaf23567835835326848f026787 Mon Sep 17 00:00:00 2001 From: Simon Fraser Date: Mon, 10 Aug 2015 20:43:15 +0100 Subject: [PATCH] to filter by filesystem type, we need to pass that up the chain --- plugins/system/disk.go | 4 ++-- plugins/system/ps.go | 1 + plugins/system/ps/disk/disk.go | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/system/disk.go b/plugins/system/disk.go index 1c5bdaef6..74348bdbe 100644 --- a/plugins/system/disk.go +++ b/plugins/system/disk.go @@ -24,9 +24,9 @@ func (s *DiskStats) Gather(acc plugins.Accumulator) error { for _, du := range disks { tags := map[string]string{ - "path": du.Path, + "path": du.Path, + "fstype": du.Fstype, } - acc.Add("total", du.Total, tags) acc.Add("free", du.Free, tags) acc.Add("used", du.Total-du.Free, tags) diff --git a/plugins/system/ps.go b/plugins/system/ps.go index f4e445dd2..760f799ca 100644 --- a/plugins/system/ps.go +++ b/plugins/system/ps.go @@ -63,6 +63,7 @@ func (s *systemPS) DiskUsage() ([]*disk.DiskUsageStat, error) { for _, p := range parts { du, err := disk.DiskUsage(p.Mountpoint) + du.Fstype = p.Fstype if err != nil { return nil, err } diff --git a/plugins/system/ps/disk/disk.go b/plugins/system/ps/disk/disk.go index fc2f79694..0aa26cd1b 100644 --- a/plugins/system/ps/disk/disk.go +++ b/plugins/system/ps/disk/disk.go @@ -6,6 +6,7 @@ import ( type DiskUsageStat struct { Path string `json:"path"` + Fstype string `json:"fstype"` Total uint64 `json:"total"` Free uint64 `json:"free"` Used uint64 `json:"used"`