Scrutiny: Use smartctl to detect all drives

Scrutiny is an App available in the Community Catalog

According to Scrutiny’s home page:

Scrutiny uses smartctl --scan to detect devices/drives

Currently, the Scrutiny app requires you to manually enter all drives that should be monitored.

Scrutiny itself uses smartctl to detect drives.

It would be a useful feature to allow “all drives” as an option in the Scrutiny app configuration dialog as an alternative to having to specify all drives manually.

This would have the effect of passing all the drives returned by smartctl --scan into the scrutiny app, rather than a customized list

This is an example run of the smartctl --scan from one of my systems with a few drives.

# smartctl --scan
/dev/sda -d scsi # /dev/sda, SCSI device
/dev/sdb -d scsi # /dev/sdb, SCSI device
/dev/sdc -d scsi # /dev/sdc, SCSI device
/dev/sdd -d scsi # /dev/sdd, SCSI device
/dev/sde -d scsi # /dev/sde, SCSI device
/dev/sdf -d scsi # /dev/sdf, SCSI device
/dev/sdg -d scsi # /dev/sdg, SCSI device
/dev/sdh -d scsi # /dev/sdh, SCSI device
/dev/sdi -d scsi # /dev/sdi, SCSI device
/dev/sdj -d scsi # /dev/sdj, SCSI device
/dev/sdk -d scsi # /dev/sdk, SCSI device
/dev/sdl -d scsi # /dev/sdl, SCSI device
/dev/sdm -d scsi # /dev/sdm, SCSI device
/dev/sdn -d scsi # /dev/sdn, SCSI device
/dev/sdo -d scsi # /dev/sdo, SCSI device
/dev/sdp -d scsi # /dev/sdp, SCSI device
/dev/sdq -d scsi # /dev/sdq, SCSI device
/dev/sdr -d scsi # /dev/sdr, SCSI device
/dev/sds -d scsi # /dev/sds, SCSI device
/dev/sdt -d scsi # /dev/sdt, SCSI device
/dev/sdu -d scsi # /dev/sdu, SCSI device
/dev/sdv -d scsi # /dev/sdv, SCSI device
/dev/sdw -d scsi # /dev/sdw, SCSI device
/dev/sdx -d scsi # /dev/sdx, SCSI device
/dev/sdy -d scsi # /dev/sdy, SCSI device
/dev/sdz -d scsi # /dev/sdz, SCSI device
/dev/sdaa -d scsi # /dev/sdaa, SCSI device
/dev/sdab -d scsi # /dev/sdab, SCSI device
/dev/sdac -d scsi # /dev/sdac, SCSI device
/dev/nvme0 -d nvme # /dev/nvme0, NVMe device
1 Like

This would be very useful and would save time in initial setup. I myself have just stumbled on this app and would like to set it up, but now need to understand how to enter in the drive paths before I can use.

For each drive, enter the full drive path, ie /dev/sda into each field.

So basically an option to, instead of adding them seperately, do the equivalent of - /dev:/dev in the compose?

I’ve been testing that actually. Haven’t been able to get it to work yet, but in theory you can.

Then Scrutiny’s use of smartctl —scan works.

1 Like

here is a mini guide to setup scrutiny for docker (i used jailmaker) in truenas

i’m assuming you already setup docker, and know how to deploy either with dockge or other methods.

This is my working docker compose

services:
  scrutiny:
    container_name: scrutiny
    image: ghcr.io/analogj/scrutiny:master-omnibus
    cap_add:
      - SYS_RAWIO
      - SYS_ADMIN
    #  environment:
    #    - COLLECTOR_CRON_SCHEDULE="0 0 * * *"
    ports:
      - 6180:8080 # webapp
      - 6186:8086 # influxDB admin
    volumes:
      - /run/udev:/run/udev:ro
      - /mnt/docker/data/scrutiny/config:/opt/scrutiny/config
      - /mnt/docker/data/scrutiny/influxdb:/opt/scrutiny/influxdb
    devices:
      - /dev/sda
      - /dev/sdb
      - /dev/sdc
      - /dev/sdd
      - /dev/nvme2n1
      - /dev/nvme0n1
      - /dev/nvme1n1
    restart: unless-stopped
networks: {}

change the sda … nvme… to match your hdds and ssds. to find that out, go to truenas ui > storage > disks. All the names should be there

note: drive names can change if you add other drives, take something out, or even plug in a usb device in the ports on your nas.

or, you can go to truenas shell and do a sudo smartctl --scan which will list them all out. not to mention it confirms your drives are detected.

Next you need to add a collector.yaml file located in your scrutiny/config folder.

This is what i use. it lists all the hdds and nvmes in my nas

devices:
  - device: /dev/sda
    type: 'sat'
  - device: /dev/sdb
    type: 'sat'
  - device: /dev/sdc
    type: 'sat'
  - device: /dev/sdd
    type: 'sat'
  - device: /dev/nvme2n1
    type: 'nvme'
  - device: /dev/nvme0n1
    type: 'nvme'
  - device: /dev/nvme1n1
    type: 'nvme'

this folder also has a scrutiny.db file. i think its generated as u deploy the compose. but if not, then try create an empty file for it.

in another folder, scrutiny/influxdb there is a config.yaml

bolt-path: /opt/scrutiny/influxdb/influxd.bolt
engine-path: /opt/scrutiny/influxdb/engine
http-bind-address: ":8086"
reporting-disabled: true

there are 2 files in this folder as well, influxd.bolt and influxd.sqlite If when you try to deploy scrutiny via dockge, but it doesn’t create these files, try create them manually with notepad with file type all, blank.

assuming you are using jailmaker to deploy your docker, you have a step requiring to modify the jailmaker config. so stop your jail first. then modify the jailmaker config e.g. jlmkr edit docker *docker is what i named my jail

then edit this line. basically just below the bpf, add the capability line

    --system-call-filter='add_key keyctl bpf'
    --capability='CAP_SYS_RAWIO,CAP_SYS_ADMIN'

you also need to add this to make your hdds and ssds accessible. modify accordingly to your own

    --bind-ro=/dev/sda
    --bind-ro=/dev/sdb
    --bind-ro=/dev/sdc
    --bind-ro=/dev/sdd
    --bind-ro=/dev/nvme2n1
    --bind-ro=/dev/nvme0n1
    --bind-ro=/dev/nvme1n1

At this point you can start your jail, truenas shell, jlmkr start docker

go to dockge, deploy that docker compose we setup earlier. it you did it correctly, it will deploy without issue. then you can click the port number in dockge to pop up the browser to view your scrutiny ui for smart status.

Enjoy :blush:

PS: this guide is just for a basic config for ssd/hdds without usage of hba pcie addon cards (refer to github for support for that config). There is a lot more u can tinker, all listed on the analogj github for scrutiny.

also if you are using scrutiny using truenas native docker, you might not need to do the capability stuff. i’m not sure but it should be full access ya?