Site Tools


Sidebar

software:scrutiny

What/Why?

We all have various disks in our systems.. which expose health data via SMART, but we need something to collect and evaluate that data. Scrutiny can do that, below notes on my setup. It's actually simple, basically 2 components:

  • web instance: Just a single instance of this is running, I run that component on a system running 24/7.
  • collectors: These are single binaries, one running on each system which has harddisks/SSDs which I want to monitor.

For communication: I have a Nebula network, which provides the participating systems a private network to communicate with each other. The 'web interface' is listening on 10.0.0.1:8080, and the 'collectors' simply run the Scrutiny-binary in time intervals, and report the data of their drives to the 'web instance'. The 'web instance' also runs an Influx db, which stores the reports it receives.

Disks/NVMe getting moved from one system to the other? The system deals nicely with that.

Web instance setup

I decided to just run a container image which includes webinterface+influxdb, with following command:

mkdir -p `pwd`/scrutiny `pwd`/influxdb2

podman run -it --rm -p 8080:8080 -p 8086:8086 \
  -v `pwd`/scrutiny:/opt/scrutiny/config,Z \
  -v `pwd`/influxdb2:/opt/scrutiny/influxdb,Z \
  -v /run/udev:/run/udev:ro,Z \
  --cap-add SYS_RAWIO \
  --cap-add SYS_ADMIN \
  --device=/dev/nvme0 \
  --name scrutiny \
  ghcr.io/analogj/scrutiny:master-omnibus

In this example, the system running the web instance container also has a disk which should be monitored, here /dev/nvme0. 'smartctl –scan' shows available disks. The 2 cap-add commands give extra caps, required to read from the container. If you run the container for example on a cloud hosted system which has no own to-be-monitored disks, these 3 lines can be left out. With this, the container is running, and one can access the interface at http://10.0.0.1:8080 .

Collectors

Multiple systems are reporting their disk status regularly to the web instance. It's as easy as running the binary and telling it where to report to. The builds for AMD64, aarch64 etc. are here.

Example on an AMD64 system:

mkdir -p /opt/scrutiny/bin
cd /opt/scrutiny/bin
wget https://github.com/AnalogJ/scrutiny/releases/download/v0.7.1/scrutiny-collector-metrics-linux-amd64
chmod +x scrutiny-collector-metrics-linux-amd64

# first run
/opt/scrutiny/bin/scrutiny-collector-metrics-linux-amd64 run \
  --api-endpoint "http://<webinstance-ip>:8080"

# adding cronjob
crontab -e
# then:
0 * * * * . /etc/profile; /opt/scrutiny/bin/scrutiny-collector-metrics-linux-amd64 run --api-endpoint "http://<webinstance-ip>:8080" >/dev/null 2>&1
software/scrutiny.txt · Last modified: 2023/05/28 11:13 by chris