Dear Friends,
Here is my configuration for monitoring disk health using scrutiny, a docker-compose application that allows to monitor disc using smartclt information.
Scrutiny can email you every time a bad sector is discovered, before the disk drive actually fails.
Here are some screenshots :
Here is the docker-compose.yml file:
services:
scrutiny:
restart: unless-stopped
container_name: scrutiny
image: ghcr.io/analogj/scrutiny:master-omnibus
environment:
- COLLECTOR_CRON_SCHEDULE=0 * * * *
cap_add:
- SYS_RAWIO
- SYS_ADMIN # Needed for NVMe
ports:
- "8080:8080" # Web Interface
volumes:
- /run/udev:/run/udev:ro
- ./config:/opt/scrutiny/config
- ./influxdb:/opt/scrutiny/influxdb
devices:
- "/dev/nvme0"
- "/dev/nvme1"
- "/dev/sda"
- "/dev/sdb"
- "/dev/sdc"
- "/dev/sdd"
- "/dev/sde"
- "/dev/sdf"
- "/dev/sdg"
- "/dev/sdh"
- "/dev/sdi"
- "/dev/sdj"
- "/dev/sdk"
- "/dev/sdl"
- "/dev/sdm"
- "/dev/sdo"
Display More
Inside your docker scrutiny folder, you will need two folders: config and influxdb
I also added the following files:
sudo cat /home/docker/scrutiny/config/collector.yaml
collector:
schedule: "@every 1h"
devices:
- device: /dev/sda
- device: /dev/sdb
- device: /dev/sdc
- device: /dev/sdd
- device: /dev/sde
- device: /dev/sdf
- device: /dev/sdg
- device: /dev/sdh
- device: /dev/sdi
- device: /dev/sdj
- device: /dev/sdk
- device: /dev/sdl
- device: /dev/sdm
- device: /dev/nvme0
- device: /dev/nvme1
api:
endpoint: "http://localhost:8080"
host:
id: "r720xd"
Display More
sudo cat /home/docker/scrutiny/config/scrutiny.yaml
# Commented Scrutiny Configuration File
web:
dashboard:
display_name: "R720xd"
listen:
port: 8080
host: 0.0.0.0
basepath: ''
database:
location: /opt/scrutiny/config/scrutiny.db
src:
frontend:
path: /opt/scrutiny/web
influxdb:
# scheme: 'http'
host: 0.0.0.0
port: 8086
retention_policy: true
log:
file: '' #absolute or relative paths allowed, eg. web.log
level: INFO
notify:
urls:
- "smtp://john_doe%40gmail.com:password@smtp.gmail.com:587/?fromAddress=john_doe@gmail.com&toAddresses=email@adress.com"
Display More
Data is collected on every startup of docker container and every hour by CRON SCHEDULE. Adapt to your needs.
The most important part is the notify line: john_doe%40gmail.com is your GMAIL email account, password is your password, john_doe@gmail.com is the sender email address and email@adress.com is the recipient. You will be notified of every disc failure.
Before everything, make sure that smartctl -x /dev/sda returns the smart information. If you are using SAS drivers, you may need to use
smartctl -d sat -x /dev/sda
Adapt /dev/sda and further to your drive list.
Also, adapt the system hostname (r720XD in my case) to your system hostname.
It should work ...
Kind regards,
R2-D2