#! /bin/sh #------------------------------------------------------------------------------ # /usr/sbin/tw_verify - verify stytus for LSI/3ware Escalade IDE RAID Adapters # # Copyright (c) 2003-2007 Maximilian Pasternak # Copyright (c) 2008-2018 The Eisfair Team, team(at)eisfair(dot)org # # Creation: 2006-10-12 max # Last Update: $Id$ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. #------------------------------------------------------------------------------ # command line parameters if [ "$1" = "-quiet" ] then quietflag='quiet' shift fi #exec 2>./tw_verify-trace-$$.log #set -x if [ "$TWADMIN_DO_DEBUG" = "yes" ] then set -x fi # read configuration if [ -f /etc/config.d/twadmin ] then . /etc/config.d/twadmin else echo "configuration file '/etc/config.d/twadmin' not found!" exit 1 fi # path to the cli TW_CLI=/usr/sbin/tw_cli # check cli version TW_CLI_TYPE='OLD' if /var/install/config.d/twadmin.sh 'is_tw_cli_type_new' then TW_CLI_TYPE='NEW' fi TW_VERIFY_SUPPORT='FALSE' if /var/install/config.d/twadmin.sh 'is_tw_cli_verify_support' then TW_VERIFY_SUPPORT='TRUE' else echo "The current installed version of the tw_cli does not support verify!" echo "aborting" exit 1 fi # iterate all LSI/3ware controllers TW_CONTROLLERS="`/var/install/config.d/twadmin.sh 'get_tw_controllers'`" for TW_C in $TW_CONTROLLERS do # iterate all units TW_UNITS="`/var/install/config.d/twadmin.sh 'get_tw_units' "${TW_C}"`" for TW_U in $TW_UNITS do TW_STATUS_TXT=`$TW_CLI info c${TW_C} u${TW_U} status` if echo "$TW_STATUS_TXT" | grep -qE "^OK|= OK$" then TW_STATUS_TXT=`$TW_CLI maint verify c${TW_C} u${TW_U}` if [ "$quietflag" != "quiet" ] then echo "$TW_STATUS_TXT" echo fi else echo "Status of controller ${TW_C}; unit ${TW_U}: TW_STATUS_TXT" echo "No verify possible for this controller!" echo fi done done set +x