Go to file
SuperQ a60837ff6e
Release v0.12.0
* [CHANGE] Better SCSI/SAS support, and removing confused metrics #168
* [ENHANCEMENT] Impvoe the JSON collection script; now requires jq/yq #176
* [BUGFIX] Shell fixes for `collect-smartctl-json.sh` #178
* [BUGFIX] Various fixes to `collect_fake_json.sh` #159

Signed-off-by: SuperQ <superq@gmail.com>
2024-03-03 16:17:14 +01:00
.circleci Update Go 2024-03-03 10:23:17 +01:00
.github Update common Prometheus files (#203) 2024-02-28 09:25:18 +01:00
systemd systemd service 2019-08-15 00:04:32 +03:00
testdata Added more testdata json's 2023-12-31 13:24:13 +03:00
.gitignore Chg: Impvoe the JSON collection script; now requires jq/yq 2023-11-15 20:43:43 -05:00
.golangci.yml Update linting 2023-08-12 10:34:18 +02:00
.promu.yml Update Go 2024-03-03 10:23:17 +01:00
.yamllint Update common Prometheus files 2023-08-12 17:49:21 +00:00
CHANGELOG.md Release v0.12.0 2024-03-03 16:17:14 +01:00
CODE_OF_CONDUCT.md Update common Prometheus files 2022-06-17 19:51:12 +00:00
Dockerfile Reverts prometheus-community/smartctl_exporter#150 2023-08-26 06:55:06 -04:00
EXAMPLE.md Added disk form_factor meta label 2022-10-17 14:28:05 +07:00
LICENSE Update LICENSE 2023-03-03 10:01:24 +01:00
MAINTAINERS.md Update maintainers (#171) 2023-10-26 10:38:59 +02:00
Makefile Reverts prometheus-community/smartctl_exporter#150 2023-08-26 06:55:06 -04:00
Makefile.common Update common Prometheus files 2024-02-06 17:50:25 +00:00
README.md Update README.md 2023-08-16 16:17:51 +08:00
SECURITY.md Update common Prometheus files 2022-06-17 19:51:12 +00:00
VERSION Release v0.12.0 2024-03-03 16:17:14 +01:00
collect-smartctl-json.sh collect-smartctl-json: shell fixes for script (#178) 2023-11-20 16:33:28 +01:00
device_filter.go Add device filtering 2022-12-09 21:12:08 +01:00
device_filter_test.go Add device filtering 2022-12-09 21:12:08 +01:00
gjsonext.go Release 0.7.0 (#50) 2022-08-05 03:37:13 +02:00
go.mod Update Go 2024-03-03 10:23:17 +01:00
go.sum Update Go 2024-03-03 10:23:17 +01:00
main.go Merge pull request #129 from Knalltuete5000/devices_count 2023-08-15 19:17:09 -04:00
metrics.go feat: Better SCSI/SAS support 2023-10-16 10:15:57 -07:00
readjson.go Update json reading logging (#198) 2024-01-25 17:52:05 +01:00
redact_fake_json.py feat: add JSON testing data 2023-11-07 22:58:28 -08:00
smartctl.go feat: Better SCSI/SAS support 2023-10-16 10:15:57 -07:00
smartctlinfo.go Avoid running mineVersion when the SMARTctlInfo struct is not ready 2022-11-06 11:56:43 +01:00

README.md

CircleCI Container Repository on Quay

smartctl_exporter

Export smartctl statistics to prometheus

Example output you can show in EXAMPLE.md

Need more?

If you need additional metrics - contact me :) Create a feature request, describe the metric that you would like to have and attach exported from smartctl json file

Requirements

smartmontools >= 7.0, because export to json released in 7.0

Configuration

Command line options

The exporter will scan the system for available devices if no --smartctl.device flags are used.

usage: smartctl_exporter [<flags>]

Flags:
  -h, --help                   Show context-sensitive help (also try --help-long and --help-man).
      --smartctl.path="/usr/sbin/smartctl"  
                               The path to the smartctl binary
      --smartctl.interval=60s  The interval between smartctl polls
      --smartctl.rescan=10m    The interval between rescanning for new/disappeared devices. If the interval is smaller than 1s no
                               rescanning takes place. If any devices are configured with smartctl.device also no rescanning takes
                               place.
      --smartctl.device=SMARTCTL.DEVICE ...  
                               The device to monitor (repeatable)
      --smartctl.device-exclude=""
                               Regexp of devices to exclude from automatic scanning. (mutually exclusive to
                               device-include)
      --smartctl.device-include=""
                               Regexp of devices to include in automatic scanning. (mutually exclusive to
                               device-exclude)
      --web.telemetry-path="/metrics"  
                               Path under which to expose metrics
      --web.systemd-socket     Use systemd socket activation listeners instead of port listeners (Linux only).
      --web.listen-address=:9633 ...
                               Addresses on which to expose metrics and web interface. Repeatable for multiple
                               addresses.
      --web.config.file=""     [EXPERIMENTAL] Path to configuration file that can enable TLS or authentication.
      --log.level=info         Only log messages with the given severity or above. One of: [debug, info, warn,
                               error]
      --log.format=logfmt      Output format of log messages. One of: [logfmt, json]
      --version                Show application version.

TLS and basic authentication

This exporter supports TLS and basic authentication.

To use TLS and/or basic authentication, you need to pass a configuration file using the --web.config.file parameter. The format of the file is described in the exporter-toolkit repository.

Example of running in Docker

Minimal functional docker-compose.yml:

version: "3"

services:
  smartctl-exporter:
    image: prometheuscommunity/smartctl-exporter
    privileged: true
    user: root
    ports:
      - "9633:9633"