Closed lswith closed 8 years ago
This patch will check for error and return it back instead of panic
diff --git a/plugins/inputs/system/ps.go b/plugins/inputs/system/ps.go
index 23bfe16..fd1b261 100644
--- a/plugins/inputs/system/ps.go
+++ b/plugins/inputs/system/ps.go
@@ -84,6 +84,9 @@ func (s *systemPS) DiskUsage(
mountpoint := os.Getenv("HOST_MOUNT_PREFIX") + p.Mountpoint
if _, err := os.Stat(mountpoint); err == nil {
du, err := disk.Usage(mountpoint)
+ if err != nil {
+ return nil, err
+ }
du.Path = p.Mountpoint
if err != nil {
return nil, err
Hmm, but why is it failing in the first place?
with that change we'll get the error message and log it, rather than panicking :)
Makes sense
2016/08/04 03:40:00 ERROR in input [disk]: error getting disk usage info: too many levels of symbolic links
Bug report
System info:
Telegraf 0.13.1 DISTRIB_ID=Ubuntu DISTRIB_RELEASE=12.04 DISTRIB_CODENAME=precise DISTRIB_DESCRIPTION="Ubuntu 12.04.5 LTS"
Relevant Config:
Error Message: