From 9886f14d14ef4e1ccf5e5c977fef60a8e6814dff Mon Sep 17 00:00:00 2001 From: Thomas Roehl Date: Fri, 13 May 2022 13:32:54 +0200 Subject: [PATCH] Check readability of sensor files in TempCollector --- collectors/tempMetric.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/collectors/tempMetric.go b/collectors/tempMetric.go index 7ba8eb1..e007099 100644 --- a/collectors/tempMetric.go +++ b/collectors/tempMetric.go @@ -116,6 +116,10 @@ func (m *TempCollector) Init(config json.RawMessage) error { } // Sensor file + _, err = ioutil.ReadFile(file) + if err != nil { + continue + } sensor.file = file // Sensor tags