Hi all,
Scrutiny is a nice and lean HDD and SSD monitoring solution relying on smartmontools to gather health data. In case of SSDs and OPNsense most importantly the "Percentage Used" (NVMe) or "Percentage Used Endurance Indicator" (SATA) values.
This post does not cover how to install and run Scrutiny - you need a dedicated Linux system for that in addition to OPNsense. The recommended way is to simply start it in Docker. I do that on TrueNAS CE where it is available as an "app".
- Scrutiny GitHup repo (https://github.com/AnalogJ/scrutiny)
- TrueNAS CE (https://www.truenas.com/truenas-community-edition/)
1. Install smartmontoolsThe easiest way is to install the os-smart plugin from System > Firmware > Plugins
2. Install the Scrutiny binary for FreeBSDAs root on OPNsense do:
cd /root
fetch https://github.com/AnalogJ/scrutiny/releases/download/v0.8.1/scrutiny-collector-metrics-freebsd-amd64
chmod 755 scrutiny-collector-metrics-freebsd-amd64
3. Create a wrapper shell scriptUse an editor to create /root/run-scrutiny.sh with this content:
#!/bin/sh
cd /root && ./scrutiny-collector-metrics-freebsd-amd64 run --api-endpoint "http://### insert your Scrutiny URL here ###" --host-id "OPNsense" --log-file "scrutiny-collector.log" >/dev/null 2>&1
Make it executable:
chmod 755 /root/run-scrutiny.sh
4. Create a symlink to activate it as a daily periodic jobcd /usr/local/etc/periodic/daily
ln -s /root/run-scrutiny.sh scrutiny
5. ResultThe stats will be updated every night at 3 am and in my case look like this:
(https://forum.opnsense.org/index.php?action=dlattach;attach=46454;image)
Clicking on the drive entry shows you all SMART attributes concerning the drive health in detail:
(https://forum.opnsense.org/index.php?action=dlattach;attach=46456;image)
So I know that I have used up 5% of the drive's guaranteed write endurance, for example.
---
Done - enjoy.
Patrick