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
Server 1 :
hdisk0 73000mb
hdisk1 73000mb
Server 2 :
hdisk 0 73000mb
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
... and I strongly agree with jools - please add this Q to the AIX zone.
ASKER
Sure I will add this in the AIX zone
ASKER
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
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
Hi, change line 9 to -
lsattr -El $disk | awk "/queue_depth/ {print \$1, \$2}"
ASKER
thanks a lot its working now
You're welcome!
Have fun and success!
Norbert (wmp)
Have fun and success!
Norbert (wmp)
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.