OPNsense Forum

English Forums => Tutorials and FAQs => Topic started by: Patrick M. Hausen on July 24, 2025, 11:40:10 AM

Title: HOWTO: monitor your SSD(s) with Scrutiny
Post by: Patrick M. Hausen on July 24, 2025, 11:40:10 AM
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.

The installation in OPNsense is done in a way which does not interfere with OPNsense configuration or updates.

February 2026: The project was recently taken over by GitHub user "Starosdev" who added many fixes and improvements including monitoring of ZFS pools. I extended these instructions to include the new repository and the new ZFS pool metrics.

Scrutiny GitHub repo (https://github.com/Starosdev/scrutiny)


1. Install smartmontools

The easiest way is to install the os-smart plugin from System > Firmware > Plugins

2. Install the Scrutiny binaries for FreeBSD

As root on OPNsense do:

cd /root
fetch https://github.com/Starosdev/scrutiny/releases/download/v1.19.2/scrutiny-collector-metrics-freebsd-amd64
fetch https://github.com/Starosdev/scrutiny/releases/download/v1.19.2/scrutiny-collector-zfs-freebsd-amd64
chmod 755 scrutiny-collector-*

3. Create a wrapper shell script

Use an editor to create /root/run-scrutiny.sh with this content:

#!/bin/sh

cd /root

./scrutiny-collector-metrics-freebsd-amd64 run --api-endpoint "https://scrutiny.mydomain.com" --host-id "OPNsense" --log-file "scrutiny-collector-metrics.log" >/dev/null 2>&1
./scrutiny-collector-zfs-freebsd-amd64 run --api-endpoint "https://scrutiny.mydomain.com" --host-id "OPNsense" --log-file "scrutiny-collector-zfs.log" >/dev/null 2>&1

Adjust the api-endpoint and host-id for your environment.

Make it executable:

chmod 755 /root/run-scrutiny.sh
4. Create a symlink to activate it as a daily periodic job

cd /usr/local/etc/periodic/daily
ln -s /root/run-scrutiny.sh scrutiny

5. Result

The 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