Link to home
Start Free TrialLog in
Avatar of jdenver247
jdenver247

asked on

Shell Script to grab some size of disks from some servers

I have 21 AIX  servers from which I need to collect the size of all SAN disks attached to each server. I have rsh enabled. I need an output something like this

Server 1 :
hdisk0       73000mb
hdisk1       73000mb

Server 2 :
hdisk 0     73000mb

Avatar of Julian Parker
Julian Parker
Flag of United Kingdom of Great Britain and Northern Ireland image

first of all you may want to see if you can add the AIX group to this Q.

How the script it written will depend on how your disks are reported onto the system.
Post the following listings back here;
   lsdev -Ccdisk
   lscfg | grep disk
   lscfg -vpl hdisk1

I sure someone will be able to knock something up.
ASKER CERTIFIED SOLUTION
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
... and I strongly agree with jools - please add this Q to the AIX zone.
Avatar of jdenver247
jdenver247

ASKER

Sure I will add this in the AIX zone
Hello,
I changed the code  lil bit.. to print the the queue_dept and here is the output

aixserver27:
hdisk6: queue_depth     256                              Queue DEPTH                      True
hdisk8: queue_depth     256                              Queue DEPTH                      True
hdisk9: queue_depth     256                              Queue DEPTH                      True
hdisk11: queue_depth     256                              Queue DEPTH                      True

How do I trim the output just to get
aixserver27:
hdisk6: queue_depth     256                            
hdisk8: queue_depth     256                              
hdisk9: queue_depth     256                              
hdisk11: queue_depth     256                              

#!/bin/ksh
for srv in $(cat dwprod)
do
rsh $srv \
     'echo \\n$(/usr/bin/hostname):
     for disk in  $(lscfg |grep hdisk | grep "NetApp" | cut -f2 -d " ")
     do
      echo ${disk}: \\c
      lsattr -El $disk |grep queue_depth
     done'
done
 

Open in new window


Hi, change line 9 to -
 
lsattr -El $disk | awk "/queue_depth/ {print \$1, \$2}"
thanks a lot its working now
You're welcome!
Have fun and success!
 
Norbert (wmp)