diff --git a/collector/hwmon_linux.go b/collector/hwmon_linux.go index 3ad469a6..476eed7b 100644 --- a/collector/hwmon_linux.go +++ b/collector/hwmon_linux.go @@ -446,7 +446,10 @@ func (c *hwMonCollector) Update(ch chan<- prometheus.Metric) error { for _, hwDir := range hwmonFiles { hwmonXPathName := filepath.Join(hwmonPathName, hwDir.Name()) - fileInfo, _ := os.Lstat(hwmonXPathName) + fileInfo, err := os.Lstat(hwmonXPathName) + if err != nil { + continue + } if fileInfo.Mode()&os.ModeSymlink > 0 { fileInfo, err = os.Stat(hwmonXPathName)