Академический Документы
Профессиональный Документы
Культура Документы
#!/bin/sh
instance=$1
export target=lxebs${instance}db1
export process_for=`echo EBS${instance} | tr '[:lower:]' '[:upper:]'
echo ${target}
echo ${process_for}
ssh ${target} /bin/df -Ph
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
---------------------------------------------------
#!/bin/sh
${vmax27_viewnames}
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
----------------------------------------------------
for i in `cat /tmp/view`; do printf "$i"; printf "\n"; symaccess -sid 13 show view
$i; sleep 2; done
for i in `cat ebstst.Oct11-Nov16_2014_3.txt`; do rm -f $i; done
for i in `cat /tmp/view';do $i;print " " ;do symaccess -sid 27 show view $i|grep
-i "Total Capacity" | awk -F" " '{print $3}' ; sleep 5; done
symaccess -sid 27 list view | awk -F" " '{print $1}' > /tmp/view3
#!/bin/sh
std_ldevs= cat /tmp/view | awk -F" " '{print $1}'
${std_ldevs};std_ldevs= cat /tmp/view | awk -F" " '{print $1}';${std_ldevs}
#!/bin/sh
zami= cat /tmp/view3 | awk -F" " '{print $1}'
${zami}
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
-----------------------------------------------------------
#!/bin/sh
${Elements}
Result is: 5
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
---------------------------------------------------------------
#!/bin/sh
for (( i=0;i<$Elements;i++)); do
$zami
done
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
------------------------------------------------------
cat /sys/class/fc_host/host*/port_name
for i in `cat /tmp/view`; do cat | awk -F" " '{print $3}' ; printf "\n"; sleep 5;
done
for i in `cat /tmp/hostlist`; do printf "$i"; printf "\n"; sudo ssh $i cat
/sys/class/fc_host/host*/port_state; printf "\n"; sleep 5; done
/tmp/hostlist
lxusphxmed01
lxobitrbdb1
lxebststdb1
lxebststdb2
lxebststdb3
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
-------------------------------------------------------
[rguggulla@lxdevtst ~]$ for i in `cat /tmp/hostlist`; do printf "$i"; printf "\n";
sudo ssh $i cat /sys/class/fc_host/host*/port_name; printf "\n"; sleep 5; done
lxusphxmed01
0x10000000c98902b2
0x10000000c98902b3
0x50014380029cc3ca
0x50014380029cc3a6
0x10000000c9890514
0x10000000c9890515
0x10000000c9890cf4
0x10000000c9890cf5
0x10000000c986fec2
0x10000000c986fec3
0x10000000c98903ba
0x10000000c98903bb
lxobitrbdb1
0x10000000c98dbfe2
0x10000000c98dbf39
0x10000000c98dbf41
0x10000000c98db7c2
lxebststdb1
0x10000000c991f8d3
0x10000000c991f86d
0x10000000c991f627
0x10000000c991f515
lxebststdb2
0x10000000c991f405
0x10000000c991c72c
0x10000000c991f848
0x10000000c991fb5e
lxebststdb3
0x10000000c991f4c4
0x10000000c991f901
0x10000000c991f8f2
0x10000000c991c788
lxobitrbdb1
Online
Online
Online
Online
lxebststdb1
Online
Online
Online
Online
lxebststdb2
Online
Online
Online
Online
lxebststdb3
Online
Online
Online
Online
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
-----
for i in `cat /tmp/view`; do printf "$i"; printf "\t";symaccess -sid 27 show view
$i|grep -i "Total Capacity" | awk -F" " '{print $3}' ; printf "\n"; sleep 5; done
lxapspj1db1 2498570
lxapspj2db1 4536339
lxapsricdb2 1931272
lxapstrnapp1 390145
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
-------------------
for i in `cat /tmp/view`; do symaccess -sid 27 show view $i|grep -i "Total
Capacity" | awk -F" " '{print $3}' ; printf "\n"; sleep 5; done ----- (working )
2252810
2498570
4536339
1931272
390145
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
----------------------------------
/tmp/hostlist2
10000000C988CBE0
10000000C988CBE1
10000000C988CBE2
10000000C988CBE3
---------------------------------------------------------------------
[rguggulla@lxdevtst ~]$ sort -f /tmp/hostlist > /tmp/hostlist1; for i in `cat
/tmp/hostlist1`; do printf "$i"; printf "\n"; sudo ssh $i cat
/sys/class/fc_host/host*/port_name| sed -r 's/^.{2}//' | sed 's/../&:/g;s/:$//';
printf "\n"; sleep 5; done
lxadmin
cat: /sys/class/fc_host/host*/port_name: No such file or directory
lxapscnvapp1
cat: /sys/class/fc_host/host*/port_name: No such file or directory
lxapsdbaapp1
50:01:43:80:09:ab:a7:c8
50:01:43:80:09:ab:a7:ca
lxapsdevdb2
50:01:43:80:12:09:f2:20
50:01:43:80:12:09:f2:22
lxapsdrdb1
cat: /sys/class/fc_host/host*/port_name: No such file or directory
lxapsglddb2
50:01:43:80:12:09:f8:84
50:01:43:80:12:09:f8:86
lxapsmdrapp1
50:01:43:80:12:0a:10:18
50:01:43:80:12:0a:10:1a
lxapsmdrdb1
50:01:43:80:12:0a:10:48
50:01:43:80:12:0a:10:4a
----------------------------------------------------
rnashef@lxdevtst> for i in 1 2 3 4; do ssh lxwsrprddb$i uptime; done
12:00:28 up 161 days, 9:42, 3 users, load average: 1.94, 1.74, 1.79
12:00:28 up 4 days, 19:37, 0 users, load average: 1.92, 1.77, 1.81
12:00:28 up 101 days, 6:45, 0 users, load average: 1.61, 1.77, 1.73
12:00:28 up 277 days, 15:28, 0 users, load average: 2.15, 2.11, 1.99
Input:
5001438003BD9052
5001438003BD9052
5001438003BD9050
5001438003BD8E36
5001438003BD8E34
5001438003BD8E36
5001438003BD902E
5001438003BD902C
5001438003BD902E
5001438007294632
----------------------------------------------------------------------------------
[root@lxusphxmed01 ~]# symaccess -sid 13 list logins | awk '{print $1,$6,$7}'
201200110a0003f0 No Yes
201200215a2f64f2 No Yes
20120024817647a3 No Yes
2012002481765a9d No Yes
2012002481766a8e No Yes
2012002481766af1 No Yes
201200248176a724 No Yes
201300110a000384 No Yes
201300215a2f64f2 No Yes
20130024817647a3 No Yes
2013002481765a9d No Yes
2013002481766a8e No Yes
2013002481766af1 No Yes
201300248176a724 No Yes
201400110a000384 No Yes
21fd0005331ee900 No Yes
symaccess -sid 13 list logins | awk '{print $1,$6,$7}' > /tmp/test1;for i in
`cat /tmp/test1`; do awk '{print $1}';printf "\n";sleep 1;done
----------------------------------------------------------------
Delete files older than 30 days
cp 2.txt 2.txt.20082703
cp 3.txt 3.txt.20082703
-----------------------------------------------------------------------
sed -i '/^[[:space:]]*$/d' mask ----- remove space between lines
00A8
0126
0127
0128
0129
012A
012B
012D
012F
0130
0131
0132
0133
[root@lxusphxmed01 ~]# nl -s "symaccess -sid 13 -type storage list -dev " mask |
cut -c7-
symaccess -sid 13 -type storage list -dev 00A8
symaccess -sid 13 -type storage list -dev 0126
symaccess -sid 13 -type storage list -dev 0127
symaccess -sid 13 -type storage list -dev 0128
symaccess -sid 13 -type storage list -dev 0129
symaccess -sid 13 -type storage list -dev 012A
symaccess -sid 13 -type storage list -dev 012B
[root@lxusphxmed01 ~]# awk '1;!(NR%1){print "sleep 2";}' mask1 > mask
[root@lxusphxmed01 ~]# cat mask | awk '{print $1}' ---- Truncate "2642 Not
Visible ???:? 10C:D4 RAID-5 N/Grp'd (M) RW 917595"
2642
28A2
28D5
2907
2939
296B
106F
1092
10AB
10C6
10DC
nl -s "symdev -sid 13 list -emulation celerra | grep -i " mask1 | cut -c7- >>
mask2
sleep 2
nl -s "symdev -sid 13 list -savedev | grep -i " mask1 | cut -c7- >> mask2
sleep 2
nl -s "symaccess -sid 13 -type storage list -dev " mask1 | cut -c7- >> mask2
sleep 2
nl -s "symaccess -sid 13 list assignment -dev " mask1 | cut -c7- >> mask2
sleep 2
nl -s "symsnap -sid 13 list | grep -i " mask1 | cut -c7- >> mask2
sleep 2
echo " " > mask3
sleep 2
awk '1;!(NR%1){print "sleep 1";}' mask2 > mask3
sleep 2
./mask3
---------------------------------------------------------------------
Logical device ID=0C71
Logical device ID=0F2E
Logical device ID=0F32
Logical device ID=0F36
Logical device ID=0F3A
Logical device ID=0F42
Logical device ID=0F46
Logical device ID=0F4A
Logical device ID=0F52
Logical device ID=0F4E
Logical device ID=148B
Logical device ID=0C6D
Logical device ID=148F
Logical device ID=0B8B
Logical device ID=0B87
Logical device ID=0B7F
Logical device ID=0B83
Logical device ID=0B7B
Logical device ID=0F26
Logical device ID=0F2A
Logical device ID=0EF0
[root@lxusphxmed01 ~]# sed 's/Logical device ID=//g' ./mask > mask1 #####
removing string from Logical device ID=0C71 and display LUN num alone.
0C71
0F2E
0F32
0F36
0F3A
0F42
0F46
0F4A
0F52
0F4E
148B
0C6D
148F
0B8B
0B87
0B7F
0B83
0B7B
0F26
0F2A
0EF0
-----------------------------------------------------------------------------------
-----
sed 's/Logical device ID=//g' ./mask > mask1 ##### removing string from Logical
device ID=0C71 and display LUN num alone
nl -s "symconfigure -sid 27 -cmd unbind tdev " mask1 | cut -c7- > mask2
#####adding a string to the LUN num and display
mask1
0C71
0F2E
0F32
0F36
0F3A
0F42
0F46
sed -e 's/^/symconfigure -sid 27 -cmd "unbind tdev /' mask1 > mask2 // prefix
---------------------------------------------
symconfigure -sid 27 -cmd "unbind tdev 0C71 from pool TP_3TB_R6;" preview -nop
sleep 2
symconfigure -sid 27 -cmd "unbind tdev 0F2E from pool TP_3TB_R6;" preview -nop
sleep 2
symconfigure -sid 27 -cmd "unbind tdev 0F32 from pool TP_3TB_R6;" commit -nop
sleep 2
symconfigure -sid 27 -cmd "unbind tdev 0F36 from pool TP_3TB_R6;" commit -nop
sleep 2
symconfigure -sid 27 -cmd "unbind tdev 0F3A from pool TP_3TB_R6;" commit -nop
sleep 2
symconfigure -sid 27 -cmd "unbind tdev 0F42 from pool TP_3TB_R6;" commit -nop
sleep 2
symconfigure -sid 27 -cmd "unbind tdev 0F46 from pool TP_3TB_R6;" commit -nop
sleep 2
symconfigure -sid 27 -cmd "unbind tdev 0F4A from pool TP_3TB_R6;" commit -nop
sleep 2
symconfigure -sid 27 -cmd "unbind tdev 0F52 from pool TP_3TB_R6;" commit -nop
sleep 2
symconfigure -sid 27 -cmd "unbind tdev 0F4E from pool TP_3TB_R6;" commit -nop
sleep 2
symconfigure -sid 27 -cmd "unbind tdev 148B from pool TP_3TB_R6;" commit -nop
sleep 2
symconfigure -sid 27 -cmd "unbind tdev 0C6D from pool TP_3TB_R6;" commit -nop
sleep 2
symconfigure -sid 27 -cmd "unbind tdev 148F from pool TP_3TB_R6;" commit -nop
sleep 2
symconfigure -sid 27 -cmd "unbind tdev 0B8B from pool TP_3TB_R6;" commit -nop
sleep 2
symconfigure -sid 27 -cmd "unbind tdev 0B87 from pool TP_3TB_R6;" commit -nop
sleep 2
symconfigure -sid 27 -cmd "unbind tdev 0B7F from pool TP_3TB_R6;" commit -nop
sleep 2
symconfigure -sid 27 -cmd "unbind tdev 0B83 from pool TP_3TB_R6;" commit -nop
sleep 2
symconfigure -sid 27 -cmd "unbind tdev 0B7B from pool TP_3TB_R6;" commit -nop
sleep 2
symconfigure -sid 27 -cmd "unbind tdev 0F26 from pool TP_3TB_R6;" commit -nop
sleep 2
symconfigure -sid 27 -cmd "unbind tdev 0F2A from pool TP_3TB_R6;" commit -nop
sleep 2
symconfigure -sid 27 -cmd "unbind tdev 0EF0 from pool TP_3TB_R6;" commit -nop
sleep 2
0C71
0F2E
0F32
0F36
0F3A
0F42
0F46
0F4A
0F52
0F4E
148B
0C6D
148F
0B8B
0B87
0B7F
0B83
0B7B
0F26
0F2A
0EF0