From a574261b3a6b68907e6880ae54fe767b710802cd Mon Sep 17 00:00:00 2001 From: Evan Phoenix Date: Mon, 6 Apr 2015 17:23:38 -0700 Subject: [PATCH] Report better errors where system stats can't be gathered --- plugins/system/system.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/system/system.go b/plugins/system/system.go index a2567c864..5e5cd93cd 100644 --- a/plugins/system/system.go +++ b/plugins/system/system.go @@ -76,7 +76,7 @@ func (s *SystemStats) Gather(acc plugins.Accumulator) error { disks, err := s.ps.DiskUsage() if err != nil { - return err + return fmt.Errorf("error getting disk usage info: %s", err) } for _, du := range disks { @@ -94,7 +94,7 @@ func (s *SystemStats) Gather(acc plugins.Accumulator) error { diskio, err := s.ps.DiskIO() if err != nil { - return err + return fmt.Errorf("error getting disk io info: %s", err) } for _, io := range diskio { @@ -114,7 +114,7 @@ func (s *SystemStats) Gather(acc plugins.Accumulator) error { netio, err := s.ps.NetIO() if err != nil { - return err + return fmt.Errorf("error getting net io info: %s", err) } for _, io := range netio { @@ -134,7 +134,7 @@ func (s *SystemStats) Gather(acc plugins.Accumulator) error { vm, err := s.ps.VMStat() if err != nil { - return err + return fmt.Errorf("error getting virtual memory info: %s", err) } vmtags := map[string]string{ @@ -155,7 +155,7 @@ func (s *SystemStats) Gather(acc plugins.Accumulator) error { swap, err := s.ps.SwapStat() if err != nil { - return err + return fmt.Errorf("error getting swap memory info: %s", err) } swaptags := map[string]string{