Commit graph

22 commits

Author SHA1 Message Date
Konstantin Shalygin
7489f4f7aa
Add support for device types and predictable device paths (rebased) (#257)
* Add better error logging on smartctl exec failure

We will now log a warning if smartctl path passed via command line is invalid.

Signed-off-by: Piotr Dobrowolski <admin@tastycode.pl>
(cherry picked from commit 1c9c6943e8)

* Add support for autoscan device types and predictable device paths

This adds a new command line option allowing for customization of
autodetected device types and enables use of special "by-id" device type
that forces use of predictable device paths (/dev/disk/by-id/...)

Relevant change to device name parsing regular expression is included
now, so predictable device paths are now also usable when directly
specified.

Signed-off-by: Piotr Dobrowolski <admin@tastycode.pl>
(cherry picked from commit 4c5f721e11)

Conflicts:
  - file: 'readjson.go'
    comment: 'manually resolve new logger issues'

* Rework device label, fix SATA discovery, per-device type specification

Signed-off-by: Piotr Dobrowolski <admin@tastycode.pl>
(cherry picked from commit 319184ce66)

Conflicts:
  - file: 'main.go'
    comment: 'manually resolve new logger issues'
  - file: 'readjson.go'
    comment: 'manually resolve new logger issues'

---------

Co-authored-by: Piotr Dobrowolski <admin@tastycode.pl>
2024-12-19 11:02:09 +01:00
TJ Hoplock
2c043b7fcb
chore!: adopt slog, drop go-kit/log (#246)
The bulk of this change set was automated by the following script which
is being used to aid in converting the various exporters/projects to use
slog:

https://gist.github.com/tjhop/49f96fb7ebbe55b12deee0b0312d8434

Other changes include:
- bumping prometheus/{common,client_golang,exporter-toolkit}
- bump minimum go version to go1.22
- remove old go-kit/log linter configs, add sloglint

Signed-off-by: TJ Hoplock <t.hoplock@gmail.com>
2024-10-18 09:18:48 +02:00
mort
3a012b5bb1 Implemented new features - extract raid member disk name.
Modified smartctl.device param - now you can set it as sda, megaraid_disk_01, etc.

Signed-off-by: Denys <zxzharmlesszxz@gmail.com>
2024-03-08 15:40:11 +01:00
David Randall
f5b403b5ba
Merge pull request #129 from Knalltuete5000/devices_count
Add counter for the number of devices configured or dynamically discovered
2023-08-15 19:17:09 -04:00
Niklas Schwarz
6f41855c36 Add background scanning for devices
Add a background routine to rescan in a specified interval for devices

Signed-off-by: Niklas Schwarz <schwarz.niklas@hotmail.de>
2023-08-10 12:10:39 +02:00
Niklas Schwarz
d26c3a82ea Add counter for the number of devices configured or dynamically discovered
Signed-off-by: Niklas Schwarz <schwarz.niklas@hotmail.de>
2023-06-28 11:40:41 +02:00
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
Michael Hanselmann
c3600bef43 Fix typo in "smarctl"
Signed-off-by: Michael Hanselmann <public@hansmi.ch>
2023-01-31 13:35:51 +01:00
SuperQ
fff5f67ae5
Add device filtering
* Add device include/exclude filters for the automatic scanning.
* Refactor scanning to not scan if devices are manually specified.
* Don't try and filter manually specified devices.

Signed-off-by: SuperQ <superq@gmail.com>
2022-12-09 21:12:08 +01: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
Perry Naseck
a972874397
update to exporter-toolkit v0.8.1
Signed-off-by: Perry Naseck <git@perrynaseck.com>
2022-10-22 14:00:37 -04:00
Ben Kochie
cee06eca3c
Merge pull request #86 from CrabappleProject/fit_windows
FIX: remove `os.stat` in order to fit in windows
2022-10-20 11:40:28 +01:00
Konstantin Shalygin
397a7a55f0 Added disk form_factor meta label
The requirement from field engineers is knowledge of the form factor of the device, i.e. 3.5", 2.5"

* updated EXAMPLE.md
* fixed copy-paste issue `Starting systemd_exporter`

Signed-off-by: Konstantin Shalygin <k0ste@k0ste.ru>
2022-10-17 14:28:05 +07: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
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
SuperQ
b9061f820c
Fix up deprecated client_golang use.
Signed-off-by: SuperQ <superq@gmail.com>
2022-06-17 13:27:10 +02: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