• Linked Applications
    Loading…

"grep" for SVC CLI


 click to expand ...

 

 


A unix like grep command for use in the CLI shell of an SVC code based system.

 

Simply copy/paste that into a SVC CLI Shell (putty) window:

grep - function definition
grep () { IFS=$'\n'; op='=='; if [[ $1 == '-v' ]]; then op='!='; shift; fi; while read l; do eval "[[ \$l $op *\$@* ]]" && echo $l; done }

Usage examples

grep - simple usage example
# Find VDisks with multiple mdisk groups

svcinfo lvdisk | grep many
grep - complex usage example
# Find specific hardware environmental information for nodes

svcinfo lsnode  -nohdr | while read id name rest ; do echo ; echo $name ; svcinfo lsnodevpd $id | grep '@(system_serial|system_product|number_of_processors|number_of_FC_cards)' ; done
grep - usage example for performance monitoring (min SVC code 6.2)
# Display specific real time node statistics 

while true ; do lsnodestats | grep '@(vdisk_ms|mdisk_ms)'; sleep 3 ; done 

 


 

Page viewed 7556 times by 6 users since Feb 13, 2013