User Tools

Site Tools


pages:scripts:raidstatus

raidstatus

#!/bin/bash
# set -x;

# 3Ware CLI RAID Report
#
# https://martinlanner.com/2013/08/24/3ware-raid-status-script/
#
# You will need to install the tw_cli utility which you can
# download for free from www.3ware.com or you can get it from
# 3rd party repositories.

##########################################################
#  Do NOT edit below unless you know what you're doing.  #
##########################################################

# Get info on RAID status
STATUS_U0=$(tw_cli info c0 u0 status | awk '{print $4}');
STATUS_U1=$(tw_cli info c0 u1 status | awk '{print $4}');

MESSAGE=$(tw_cli info);
echo "${MESSAGE}";

# Check the status and set return-code
if [ "${STATUS_U0}" != "OK" ] || [ "${STATUS_U1}" != "OK" ];
then
        # RAID must be not OK - ERROR!
        exit 1;
fi
exit 0;

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
pages/scripts/raidstatus.txt · Last modified: 2022/12/31 00:15 by Heiko Mischer