Commit graph

16 commits

Author SHA1 Message Date
SuperQ
5bd7420ca8
Update build
* Update Go to 1.20.
* Update CI orb.
* Update golangci-lint.
* Update Go modules.
* Use new landing page function.

Signed-off-by: SuperQ <superq@gmail.com>
2023-04-12 09:36:11 +02:00
Jakub Klinkovský
6e2143ca62 Remove useless error message
All errors are already logged from the called functions: readSMARTctl,
resultCodeIsOk, jsonIsOk. Logging twice due to the same error is useless
and the "smartctl returned bad data for device" message is confusing
since that condition may happen when a device is in a low-power mode.

Signed-off-by: Jakub Klinkovský <j.l.k@gmx.com>
2022-11-06 11:56:41 +01:00
David Randall
18b5b8d57e Fixes #23: Race condition with maps and goroutines
Signed-off-by: David Randall <David@NiceGuyIT.biz>
2022-11-05 08:55:14 -04:00
赵栩彬
daf1182285 FIX: remove os.stat in order to fit in windows
Signed-off-by: 赵栩彬 <zhaoxubin2016@mail.com>
2022-10-15 11:46:28 +08:00
Ben Kochie
e88442081c
Adjust smartctl command args (#74)
Update smartctl command arguments to reduce device wakeup from
standby/idle.
* Ignore exit code of 2 for sleeping devices.

Fixes: https://github.com/prometheus-community/smartctl_exporter/issues/61

Signed-off-by: SuperQ <superq@gmail.com>

Signed-off-by: SuperQ <superq@gmail.com>
2022-10-03 14:49:32 +02:00
Ben Kochie
c8d3e48f3d
Refactor exporter config (#68)
Switch exporter over to standard Prometheus exporter flags and logging.
This eliminates the need for a configuraion file.

Signed-off-by: SuperQ <superq@gmail.com>
2022-10-03 11:16:00 +02:00
Ben Kochie
920c3429b1
Release 0.7.0 (#50)
First prometheus-community release.

* [FEATURE] Add various new metrics #14
* [BUGFIX] Fix exit code bit parsing #37

Signed-off-by: SuperQ <superq@gmail.com>
2022-08-05 03:37:13 +02:00
Andreas Fuchs
d33d18e535
Return the cached value if it's not time to scan again yet (#18)
* Return the cached value if it's not time to scan again yet

This should ensure that if we have a valid value cached (which ought
to be every time after the first scan), we return it as metrics.

This fixes the crashes that would happen if queries happened earlier
than the re-scan interval allowed.

* Address review feedback: Shorten the time-to-scan logic

We can express this in a single if statement, so it takes fewer lines
to do the "should we check again" check.
2022-08-05 03:09:55 +02:00
Ben Kochie
1625848c5d
Merge pull request #37 from singron/fix-reversed-bits
Fix exit code bit parsing
2022-07-17 15:22:32 +02:00
SuperQ
c0e4746c80
Update build for prometheus-community
Use standard Prometheus Community build infra.
* Update Go modules for new location
* Update references to github URLs
* Update for Go 1.17+

Signed-off-by: SuperQ <superq@gmail.com>
2022-06-17 12:04:48 +02:00
Eric Culp
6b6fd628d2 Fix exit code bit parsing
The previous code was parsing left-to-right, but the bits are actually
numbered right-to-left (least to most significant). Instead of
converting to strings, just use bitmasks.

Fixes https://github.com/prometheus-community/smartctl_exporter/issues/22

Signed-off-by: Eric Culp <eculperic@gmail.com>
2022-03-17 16:57:34 -06:00
Горлов Максим
e27581d56a apply merges 2020-11-14 18:36:34 +03:00
Горлов Максим
cbc437fea9 Parsing smartctl error code; parsing resulting json for smartctl errors; docker moved to subfolder 2020-10-30 00:35:49 +03:00
Christian Pedersen
593ca96a99 Automatically load the available devices 2020-10-06 13:05:00 +02:00
Горлов Максим
beb765eb1a option for set minimum time period between run smartctl; smartctl info metric 2019-08-16 00:01:16 +03:00
Горлов Максим
9e6e240e85 First commit 2019-08-14 23:34:49 +03:00