We provide managed hosting and co-locating services out of Amsterdam.

ServicesProjectsMirrorsGistsGitContact us

Using sensorsd with raid on OpenBSD

In sensorsd.conf we added the following:

drive:command=/etc/sensorsd/drive %t %n %2 %s

The parameters used are:

The script which sends the notification email is:

#!/bin/sh
echo "Current raid state: ${1}${2} ${3} ${4}" | mail -s "$(hostname) ${1}${2} ${4}" -r noreply@example.com admin@example.com

When anything happens you will get an email which looks like:

From: noreply@example.com
To: admin@example.com
Subject: host1.high5.nl drive0 WARN

Current raid state: drive0 pfail WARN