diff --git a/plugins/inputs/phpfpm/phpfpm.go b/plugins/inputs/phpfpm/phpfpm.go index 52907bb50..dd7d6a630 100644 --- a/plugins/inputs/phpfpm/phpfpm.go +++ b/plugins/inputs/phpfpm/phpfpm.go @@ -7,7 +7,6 @@ import ( "io" "net/http" "net/url" - "os" "strconv" "strings" "sync" @@ -301,25 +300,18 @@ func globUnixSocket(url string) ([]string, error) { } paths := glob.Match() if len(paths) == 0 { - if _, err := os.Stat(paths[0]); err != nil { - if os.IsNotExist(err) { - return nil, fmt.Errorf("Socket doesn't exist '%s': %s", pattern, err) - } - return nil, err - } - return nil, nil + return nil, fmt.Errorf("socket doesn't exist %q: %v", pattern, err) } - addrs := make([]string, 0, len(paths)) - + addresses := make([]string, 0, len(paths)) for _, path := range paths { if status != "" { path = path + ":" + status } - addrs = append(addrs, path) + addresses = append(addresses, path) } - return addrs, nil + return addresses, nil } func unixSocketPaths(addr string) (string, string) {