Hello,
I use 2 linux STB xtrend ET9200 and ET10000 running current OpenPLi 4.0 / enigma2, as on any other server or pc I am monitoring SMART data/run selftests of the HDDs.
Therefor smartmontools is available:
root@et10000:/etc/init.d# opkg info smartmontools
Package: smartmontools
Version: 5.42-r1.0.0
Depends: libgcc1 (>= 4.9.1), libstdc++6 (>= 4.9.1), libc6 (>= 2.20)
Status: install user installed
Section: console/utils
Architecture: mips32el
Maintainer: OE-Core Developers
MD5Sum: fa440baab23bb6ecea6c4361fd8ad6fb
Size: 310458
Filename: smartmontools_5.42-r1.0.0_mips32el.ipk
Source:
http://downloads.sourceforge.net/smartmontools/smartmontools-5.42.tar.gz
Description: Control and monitor storage systems using S.M.A.R.T. Control and monitor
storage systems using S.M.A.R.T..
Installed-Time: 1483087735
But the package lacks an init script, so I modified the current sourceforge one, wrote to /etc/init.d/smartd, created symlinks /etc/rc[2-5].d/S25smartd.
Works perfectly with all options. init script attached. Maybe something (including creation of symlinks) to add to the package.
root@et10000:/etc/init.d# /etc/init.d/smartd
Usage: /etc/init.d/smartd {start|stop|restart|force-reload|reload|report|status}
root@et10000:/etc/init.d# /etc/init.d/smartd force-reload
Reload S.M.A.R.T. daemon: smartd.
root@et10000:/etc/init.d# /etc/init.d/smartd status
/usr/sbin/smartd is running.
root@et10000:/etc/init.d# /etc/init.d/smartd report
Checking SMART devices now.
reporting to syslog:
2016-12-30T11:59:15+01:00 et10000.swabian.net smartd[4455]: Signal HUP - rereading configuration file /etc/smartd.conf
2016-12-30T11:59:15+01:00 et10000.swabian.net smartd[4455]: Opened configuration file /etc/smartd.conf
2016-12-30T11:59:15+01:00 et10000.swabian.net smartd[4455]: Configuration file /etc/smartd.conf was parsed, found DEVICESCAN, scanning devices
2016-12-30T11:59:15+01:00 et10000.swabian.net smartd[4455]: Device: /dev/sda, type changed from 'scsi' to 'sat'
2016-12-30T11:59:15+01:00 et10000.swabian.net smartd[4455]: Device: /dev/sda [SAT], opened
2016-12-30T11:59:15+01:00 et10000.swabian.net smartd[4455]: Device: /dev/sda [SAT], ST31000526SV, S/N:9VP94MD2, WWN:5-000c50-03cf74e18, FW:CV15, 1.00 TB
2016-12-30T11:59:15+01:00 et10000.swabian.net smartd[4455]: Device: /dev/sda [SAT], not found in smartd database.
2016-12-30T11:59:15+01:00 et10000.swabian.net smartd[4455]: Device: /dev/sda [SAT], enabled SMART Attribute Autosave.
2016-12-30T11:59:15+01:00 et10000.swabian.net smartd[4455]: Device: /dev/sda [SAT], enabled SMART Automatic Offline Testing.
2016-12-30T11:59:15+01:00 et10000.swabian.net smartd[4455]: Device: /dev/sda [SAT], is SMART capable. Adding to "monitor" list.
2016-12-30T11:59:15+01:00 et10000.swabian.net smartd[4455]: Monitoring 1 ATA and 0 SCSI devices
2016-12-30T11:59:37+01:00 et10000.swabian.net smartd[4455]: Signal USR1 - checking devices now rather than in 1281 seconds.
this is what I added to the original init script:
# enigma2 case
elif [ -f /etc/enigma2/version.cfg ] ; then
test -x $SMARTD_BIN || exit 5
RET=0
# Existence of config file is optional
SMARTD_CONFIG=/etc/smartd.conf
SMARTDPID=/var/run/smartd.pid
smartd_opts=
if test -n "$SMARTD_CHECK_INTERVAL" -a "$SMARTD_CHECK_INTERVAL" != 1800 ; then
smartd_opts=" -i $SMARTD_CHECK_INTERVAL"
fi
if test -n "$SMARTD_LOG_FACILITY" -a "$SMARTD_LOG_FACILITY" != "daemon" ; then
smartd_opts="$smartd_opts -l $SMARTD_LOG_FACILITY"
fi
if test -n "$SMARTD_DRIVEDB" ; then
smartd_opts="$smartd_opts -B $SMARTD_DRIVEDB"
fi
if test "$SMARTD_SAVESTATES" = "no" ; then
smartd_opts="$smartd_opts -s \"\""
fi
if test "$SMARTD_ATTRLOG" = "no" ; then
smartd_opts="$smartd_opts -A \"\""
fi
if test -n "$SMARTD_EXTRA_OPTS" ; then
smartd_opts="$smartd_opts $SMARTD_EXTRA_OPTS"
fi
smartd_opts="--pidfile $SMARTDPID $smartd_opts"
case "$1" in
start)
echo -n "Starting S.M.A.R.T. daemon: smartd"
if start-stop-daemon -S -q -p $SMARTDPID \
-x $SMARTD_BIN -- $smartd_opts; then
echo "."
else
echo " (failed)"
RET=1
fi
;;
stop)
echo -n "Stopping S.M.A.R.T. daemon: smartd"
start-stop-daemon -K -q -o -p $SMARTDPID
echo "."
;;
restart)
$0 stop
$0 start
;;
force-reload)
$0 reload || $0 restart
;;
reload)
echo -n "Reload S.M.A.R.T. daemon: smartd"
if start-stop-daemon -K -q -s 1 \
-p $SMARTDPID; then
echo "."
else
echo " (failed)"
RET=1
fi
;;
report)
echo -n "Checking SMART devices now"
if start-stop-daemon -K -q -s 16 \
-p $SMARTDPID; then
echo "."
else
echo " (failed)"
RET=1
fi
;;
status)
if pidof $SMARTD_BIN >/dev/null; then
echo "$SMARTD_BIN is running."
else
echo "$SMARTD_BIN is not running."
RET=1
fi
;;
*)
echo "Usage: $0 {start|stop|restart|force-reload|reload|report|status}"
exit 1
esac
exit $RET