Running SMART tests against MegaRAID controllers


#1

smartctl can gather SMART data and run tests for individual drives on a MegaRAID controller. To do this the device type and bus id must be passed to smartctl. To determine the bus ids the proprietary tool, storcli, from Broadcom must be used. As this tool is unavailable in the archives or a Snap MAAS cannot ship with a script which automatically installs the tool. As of MAAS 2.5 the smartctl tests have been modified to detect if being run against a MegaRAID controller and the storcli tool is available. The script below will download and install storcli before starting the smartctl test so MegaRAID controllers can be used.

#!/bin/bash -ex
#
# MegaRAID tools installer
#
# --- Start MAAS 1.0 script metadata ---
# name: megaraid-tools-installer
# title: MegaRAID tool installer
# tags: commissioning
# script_type: test
# hardware_type: storage
# packages:
#  url: https://docs.broadcom.com/docs-and-downloads/raid-controllers/raid-controllers-common-files/1.23.02_StorCLI.zip
#  apt: unzip
# timeout: 00:02:00
# --- End MAAS 1.0 script metadata ---

cd $DOWNLOAD_PATH
unzip storcli_All_OS.zip
sudo -n dpkg -i storcli_All_OS/Ubuntu/*.deb