diff options
Diffstat (limited to 'collector/drbd_linux.go')
-rw-r--r-- | collector/drbd_linux.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/collector/drbd_linux.go b/collector/drbd_linux.go index 4beb31d..281c079 100644 --- a/collector/drbd_linux.go +++ b/collector/drbd_linux.go | |||
@@ -17,6 +17,7 @@ package collector | |||
17 | 17 | ||
18 | import ( | 18 | import ( |
19 | "bufio" | 19 | "bufio" |
20 | "errors" | ||
20 | "fmt" | 21 | "fmt" |
21 | "os" | 22 | "os" |
22 | "strconv" | 23 | "strconv" |
@@ -188,7 +189,7 @@ func (c *drbdCollector) Update(ch chan<- prometheus.Metric) error { | |||
188 | statsFile := procFilePath("drbd") | 189 | statsFile := procFilePath("drbd") |
189 | file, err := os.Open(statsFile) | 190 | file, err := os.Open(statsFile) |
190 | if err != nil { | 191 | if err != nil { |
191 | if os.IsNotExist(err) { | 192 | if errors.Is(err, os.ErrNotExist) { |
192 | level.Debug(c.logger).Log("msg", "stats file does not exist, skipping", "file", statsFile, "err", err) | 193 | level.Debug(c.logger).Log("msg", "stats file does not exist, skipping", "file", statsFile, "err", err) |
193 | return ErrNoData | 194 | return ErrNoData |
194 | } | 195 | } |