AMCC 9590SE-4ME manual Using an input file to execute a script, Outputting the CLI to a Text File

Page 13

Working with 3ware CLI

Using an input file to execute a script

You can operate 3ware CLI scripts by executing a file. The file is a text file containing a list of CLI commands which you have entered in advance. Each command must be on a separate line.

Syntax

tw_cli -f <filename>

Where <filename> is the name of the text file you want to execute.

Example

tw_cli -f clicommand.txt

This example executes the file clicommand.txt, and runs the CLI commands included in that file.

Scripting example

Following is a a scripting example using a text file called config_unit.txt, containing three commands. This example sets up a 4-port controller with two units, each with 2 drives mirrored. It then prints the configurations for verification. The commands included in the script file are:

/c0 add type=raid1 disk=0-1 /c0 add type=raid1 disk=0-1 /c0 show

Outputting the CLI to a Text File

You can have the output of the 3ware CLI, including errors, sent to a text file by adding 2>&1 to the end of the line. This could be useful, for example, if you want to email the output to AMCC Technical Support.

Examples

tw_cli /c2/p0 show >> controller2port0info.txt 2>&1

or

tw_cli /c0 show diag >> Logfile.txt 2>&1

www.3ware.com

7

Image 13
Contents 3ware Command Line InterfaceCopyright Table of Contents Page Cx/ux set autoverify=onoff Return Code About this CLI Guide Page Features of the CLI Introduction to the 3ware Command Line InterfaceTerminology Supported Operating SystemsWorking with 3ware CLI Installing the 3ware CLI on Mac OSUsing a single command with output Using the command interface interactivelyOutputting the CLI to a Text File Using an input file to execute a scriptConventions Understanding RAID Levels and ConceptsRAID Concepts RAID Available RAID ConfigurationsRAID 0 Configuration Example RAID 5 Configuration Example Single Disk Determining What RAID Level to UseUsing Drive Capacity Efficiently CLI Syntax Reference Common Tasks Mapped to CLI CommandsCommon Tasks Mapped to CLI Commands Common Tasks Mapped to CLI Commands Syntax Overview Focus Object Shell Object CommandsShow Show ver Show diag Show alarms reverseShow rebuild Show selftest Show verifyFlush Update fw=filenamewithpath forceRescan CommitCx show Controller Object CommandsCx show Typical output looks like Cx show attribute attributeCx show driver Cx show biosCx show model Cx show firmwareCx show pcb Cx show serialCx show pchip Cx show achipCx show numunits Cx show numportsCx show ctlbus Cx show exportjbodCx show stagger Cx show spinupCx show ondegrade Cx show autocarveCx show memory Cx show carvesizeCx show unitstatus Cx show autorebuildCx show drivestatus Cx show allunitstatus3JV3MVTA Cx show allSupported Stripe Sizes Controller Object Commands Supported Model-Unit Types for ignoreECC Cx rescan noscanCx commit Cx update fw=filenamewithpath forceCx flush Cx show diag Cx show alarms reverseCx show rebuild RAID-5 Initializing Cx show verify Cx show selftest Cx add rebuild=dddhhduration Setting Up a Rebuild ScheduleCx add verify=dddhhduration Setting Up a Verify ScheduleCx del rebuild=slotid Cx add selftest=dddhhCx del verify=slotid Cx set rebuild=enabledisable1..5Cx del selftest=slotid Cx set selftest=enabledisable task=UDMASMART Cx set verify=enabledisable1..5Cx set exportjbod=onoff Cx set spinup=nn Cx set ondegrade=cacheofffollowCx set stagger=nn Cx set autocarve=onoffCx set autorebuild=onoff Cx set carvesize=1024..2048Cx stop mediascan Cx start mediascanCx/ux show Unit Object CommandsCx/ux show status Cx/ux show attribute attributeCx/ux show verifystatus Cx/ux show rebuildstatusCx/ux show initializestatus Cx/ux show nameCx/ux show storsave Cx/ux show qpolicyCx/ux show identify Cx/ux show autoverifyCx/ux show cache Cx/ux show volumesCx/ux show ignoreECC Cx/ux show allCx/ux del noscan quiet Cx/ux remove noscan quietCx/ux start verify Cx/ux start rebuild disk=pp-p...ignoreECCCx/ux resume rebuild Cx/ux pause rebuildCx/ux stop verify Cx/ux set autoverify=onoff Cx/ux flushCx/ux set cache=onoff quiet Cx/ux set ignoreECC=onoff Cx/ux set identify=onoffCx/ux set name=string Cx/ux set qpolicy=onoffCx/ux set storsave=protectbalanceperform quiet By default, qpolicy is offExample Valid Migration Paths Supported Stripe Sizes Migration Process 3JV2Q1VA Cx/px show Port Object CommandsCx/px show attribute attribute Cx/px show model Cx/px show statusCx/px show serial Cx/px show firmwareCx/px show lspeed Cx/px show ncqCx/px show capacity Cx/px show smartCx/px show all Cx/px set identify=onoff Cx/px remove noscan quietCx/bbu show BBU Object CommandsCx/bbu show status Cx/bbu show attribute attributeCx/bbu show lasttest Cx/bbu show batinstCx/bbu show volt Cx/bbu show tempCx/bbu show serial Cx/bbu show bootloaderCx/bbu show fw Cx/bbu show pcbCx/bbu disable quiet Cx/bbu enableEx show Enclosure Object CommandsEx show controllers Ex show attribute attributeEx show slots Ex show temp Ex show fansEx show all Ex/slotx showEx/slotx set identify=onoff Ex/slotx show identifyEx/fanx show Ex/tempx showHelp with specific commands Help CommandsHelp with attributes Help show HelpHelp flush Help rescan Help updateHelp commit Help focusReturn Code