Home assistant addon : Scrutiny (SMART dashboard)

Thanks for the explanations, I’ve pushed a new version with an optional COLLECTOR_API_ENDPOINT that only gets applied if you select collector mode

Hope it will works!

Absolutely perfect!

(The top one is HomeAssistant)

Thank you!

1 Like

Hello @alexbelgium, I finally know how to configure my USB NVME enclosure in Scrutiny, but for that, I would need to modify the collector.yaml config file. Would you be able to expose it for your add-on? Thanks!

Hello Alex and Everyone, I have recently installed Scrutiny on my Rpi-4 based HA (running on NVMe SSD conncted via USB 3.0 port using SMART supported enclosure). However, I couldn’t get SMART info nor temperature. All the time I am getting errors recorded in the log file as below. Can some help me understand what I am doing wrong here? Does Scrutiny not support Rpi-4 base HA OS? My Scrutiny WebUI page was empty until now and after updating it to v0.5.0-6test, WebUI does not load at all and it just keep showing scrutiny logo and three pink dots! Thanks for your help.

JSON result was not a dictionary or list with 0th element a dictionary

19:38:31 – (WARNING) RESTful - message first occurred at 6 December 2022 at 00:42:31 and shows up 2574 times

REST result could not be parsed as JSON

19:38:31 – (WARNING) RESTful - message first occurred at 6 December 2022 at 00:42:31 and shows up 5148 times

Empty reply found when expecting JSON data

19:28:31 – (WARNING) RESTful - message first occurred at 19:26:31 and shows up 9 times

Error fetching data: http://192.168.1.100:8096/api/summary failed with All connection attempts failed

19:28:31 – (ERROR) RESTful - message first occurred at 19:26:31 and shows up 9 times

I have a similar problem, running HassOS on Rpi-4b, booting from USB in SMART-supported enclosure via USB 3.0 port. After installing the add-on, the web UI loads ok and yet it shows know data. In the add-on log, I get this message:
Could not retrieve device information for sda: exit status 2
There are no other error messages I can see in that log or in the Supervisor log.

I tried the HDD Tools add-on and wasn’t able to get any SMART data there, either (its sensor just reported temperature=null).

Have others actually got this working with HassOS? Or with a similar config involving USB SSD for boot and data?

Hi, done through github request :

if bashio::config.true "expose_collector"; then
    bashio::log.info "collector.yaml exposed in /share/scrutiny. It will only be accessible if the addon is running"

It might be the solution to the two other issues above…

Hello, I get this in the log and /share/scrutiny is an empty folder:

[13:50:13] INFO: collector.yaml exposed in /share/scrutiny. It will only be accessible if the addon is running
cp: cannot stat '/data/config/collector.yaml': No such file or directory
rm: cannot remove '/data/config/collector.yaml': No such file or directory

By the way, would it not make more sense to have it in config instead of share?

The error is gone in the latest version, but it looks like I need the functionality in the full access version, because I always tested on that one. The standard version of Scrutiny gives me this in the log after I made my changes to collector.yaml:

time="2022-12-27T21:00:01+01:00" level=info msg="Verifying required tools" type=metrics
time="2022-12-27T21:00:01+01:00" level=info msg="Executing command: smartctl --scan --json" type=metrics
time="2022-12-27T21:00:01+01:00" level=info msg="Executing command: smartctl --info --json --device sntjmicron /dev/sda" type=metrics
time="2022-12-27T21:00:01+01:00" level=error msg="Could not retrieve device information for sda: exit status 2" type=metrics

This is in line with trying directly from the container’s console:

root@db21ed7f-scrutiny:/opt/scrutiny# smartctl --all -d sntjmicron /dev/sda
smartctl 7.2 2020-12-30 r5155 [aarch64-linux-5.15.80] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org

Smartctl open device: /dev/sda [USB NVMe JMicron] failed: Operation not permitted

My collector.yaml looks like this:

devices:
  - device: /dev/sda
    type: 'sntjmicron'

But when I try directly from the full access version, I get the correct results:

root@db21ed7f-scrutiny-fa:/opt/scrutiny# smartctl --all -d sntjmicron /dev/sda
smartctl 7.2 2020-12-30 r5155 [aarch64-linux-5.15.80] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Number:                       ADATA SX8200PNP
Serial Number:                      #########
Firmware Version:                   42AZS6AC
PCI Vendor/Subsystem ID:            0x1cc1
IEEE OUI Identifier:                0x000000
Controller ID:                      1
NVMe Version:                       1.3
Number of Namespaces:               1
Namespace 1 Size/Capacity:          1,024,209,543,168 [1.02 TB]
Namespace 1 Utilization:            646,954,123,264 [646 GB]
Namespace 1 Formatted LBA Size:     512
Local Time is:                      Tue Dec 27 21:29:23 2022 CET
Firmware Updates (0x14):            2 Slots, no Reset required
Optional Admin Commands (0x0017):   Security Format Frmw_DL Self_Test
Optional NVM Commands (0x005f):     Comp Wr_Unc DS_Mngmt Wr_Zero Sav/Sel_Feat Timestmp
Log Page Attributes (0x0b):         S/H_per_NS Cmd_Eff_Lg Telmtry_Lg
Maximum Data Transfer Size:         64 Pages
Warning  Comp. Temp. Threshold:     75 Celsius
Critical Comp. Temp. Threshold:     80 Celsius

Supported Power States
St Op     Max   Active     Idle   RL RT WL WT  Ent_Lat  Ex_Lat
 0 +     9.00W       -        -    0  0  0  0        0       0
 1 +     4.60W       -        -    1  1  1  1        0       0
 2 +     3.80W       -        -    2  2  2  2        0       0
 3 -   0.0450W       -        -    3  3  3  3     2000    2000
 4 -   0.0040W       -        -    4  4  4  4    15000   15000

Supported LBA Sizes (NSID 0x1)
Id Fmt  Data  Metadt  Rel_Perf
 0 +     512       0         0

=== START OF SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

SMART/Health Information (NVMe Log 0x02)
Critical Warning:                   0x00
Temperature:                        37 Celsius
Available Spare:                    100%
Available Spare Threshold:          10%
Percentage Used:                    1%
Data Units Read:                    29,199,048 [14.9 TB]
Data Units Written:                 20,366,054 [10.4 TB]
Host Read Commands:                 790,413,091
Host Write Commands:                392,290,447
Controller Busy Time:               36,038,382
Power Cycles:                       162
Power On Hours:                     11,005
Unsafe Shutdowns:                   114
Media and Data Integrity Errors:    0
Error Information Log Entries:      0
Warning  Comp. Temperature Time:    0
Critical Comp. Temperature Time:    0
Thermal Temp. 1 Transition Count:   8
Thermal Temp. 2 Transition Count:   4
Thermal Temp. 1 Total Time:         141
Thermal Temp. 2 Total Time:         24

Error Information (NVMe Log 0x01, 16 of 256 entries)
No Errors Logged
1 Like

Hi, thanks for the feedback, I’ve just pushed a new version to align codes from both addons

I still do not see the option to expose collector.yaml in the configuration tab of the Full Access version of the add-on.

Scrutiny Full Access latest version works for me with the collector.yaml I shared in Home assistant addon : Scrutiny (SMART dashboard) - #69 by hubikj.

1 Like

Hi hubikj, Are you using HA on Rpi-4 or as docker or on computer?

Finally after debugging a lot and entering inside grafana’s container, I managed to get smart data from scrutiny as below :partying_face: (no wonder I see my SMART data failed as there was some issue but I rectified it now.) I am using HA on Rpi-4b model and SSD is connected through NVMe enclosure (Realtek RTL9210B chip) so now learned that scrutiny (full access) works just fine on Rpi-4.

Couple of important things, I’d like to mention here to get scrutiny working: (1) My SSD enclosure chip is Realtek RTL9210B so scrutiny (as per smartmontools) I should get SMART data if I set smartctl_command_device_type to auto or sntrealtek but it does not work that way probably because old kernel does not support. I could see while debuging that auto device type was selecting sntrealtek automatically internally and log was generatting following error

time="2023-01-01T12:44:49Z" level=info msg="Verifying required tools" type=metrics
time="2023-01-01T12:44:49Z" level=info msg="Executing command: /usr/sbin/smartctl --scan --json --dev auto" type=metrics
time="2023-01-01T12:44:49Z" level=info msg="Executing command: /usr/sbin/smartctl --info --json --dev auto --device sntrealtek /dev/sda" type=metrics
time="2023-01-01T12:44:49Z" level=error msg="Could not retrieve device information for sda: exit status 2" type=metrics
time="2023-01-01T12:44:49Z" level=info msg="Sending detected devices to API, for filtering & validation" type=metrics

So important here is to set device type sat and do not leave it auto. I got this tip from smartmontools wiki. and (2) scrutiny retrives SMART data only in full access mode otherwise it will generate similar error as above. Docker scrutiny is already a member of the group “disk” so technically there should not be a problem but it does not get permission to get to the hardware. (3) Protection mode must be disabled in scrutiny (full access) otherwise it will not be able to get SMART data for the same reason.

1 Like

@nate.eaton.jr Hi, See my previous comment. This might help you as well :wink:

Thanks, that helped! For me, it just took installing the Full Access add-on with protection mode disabled and now I’m getting results. Although I didn’t have to explicitly specify the device type for it to work, I went back and did that, too.

As I’d had some lagginess in my HASSOS platform a while back, I had wanted to be sure it wasn’t the SSD having issues. The good news is that the lagginess seemed to have (mostly) resolved so I wasn’t stressing about access to SMART data any more but I really want to have a complete view of the hub so this is great to finally have.

2 Likes

I am using Home Assistant Blue with external NVME SSD.

Alright. Thanks. My problem is now got solved.

Do we need to do anything special for the disks to show up?
I use Scrutiny on a few other systems, and we usually have to pass through some variables at container runtime for the disks to show, but I dont see an option here for this container?

Thanks!

##EDIT##
Reading above, it looks to be a similar thing experienced by someone else, with a USB enclosure perhaps being an issue.
Is there any workaround for a Realtek based enclosure?

Some RealTek chips work in auto mode and some in sat only. Try seting smartctl_command_device_type either auto or sat and make sure you have disabled protection from scrutiny (full access) info tab. Observe your logs afterwords it this doesn’t work!

Thanks, that did it.
SAT mode, protection off on the ‘full’ version. :slight_smile:

2 Likes