Friday, December 11, 2009

SCRIPT - bash - Loop through a list of hosts and display index count

In this example, we are looping through a list of hosts specified in a given file and copying a script to each host :

list=hosts-SiebelCRM.list; i=1; count=`wc -l $list | awk '{print $1}'`; for host in `cat $list`; do echo "----- $host : [$i] of $count -----"; scp ~/scripts/parse-syslog.pl $host:.; i=`expr $i + 1`; done

Monday, October 6, 2008

Working on vi with a wider terminal on Solaris

When using vi on Solaris, sometimes when the screen is quite wide you get a "Terminal too wide" error.

In order to get around this, simply run the command :

stty columns 160

and you should be able to run vi with a bigger terminal.

Tuesday, July 8, 2008

VxFS - Determine available space in a diskgroup.

vxassist -g <diskgroup> maxsize

vxdg -g <diskgroup> | awk '{sum = sum + $5} END {print sum/2/1024/1024}'