AIX 6/7 Script to create a file with commands to remove missing and failed paths

To create a file with commands to remove the missing paths

1
2
3
4
5
6
7
8
9
#!/bin/sh
# rmpaths
>xrmpaths
echo "#!/bin/sh" >>xrmpaths
disks=$(lspv | awk '{print $1}')
for loop in $disks
do
lspath -l $loop -H -F "name:parent:connection:status" |grep Missing| awk -F: '{print "rmpath -dl",$1,"-p", $2, "-w", $3}'>>xrmpaths
done

 

To create a file with commands to remove the failed paths

1
2
3
4
5
6
7
8
9
#!/bin/sh
# rmpaths
>xrmpaths
echo "#!/bin/sh" >>xrmpaths
disks=$(lspv | awk '{print $1}')
for loop in $disks
do
lspath -l $loop -H -F "name:parent:connection:status" |grep Failed| awk -F: '{print "rmpath -dl",$1,"-p", $2, "-w", $3}'>>xrmpaths
done
5 (1)
Article Rating (1 Votes)
Rate this article
Attachments
There are no attachments for this article.
Comments
There are no comments for this article. Be the first to post a comment.
Full Name
Email Address
Security Code Security Code
Related Articles RSS Feed
AIX Undocumented AIX command lquerypv
Viewed 4234 times since Tue, Jul 17, 2018
0516-404 allocp: This system cannot fulfill the allocation request. [AIX]
Viewed 6050 times since Thu, Sep 20, 2018
AIX, Security, System Admin↑ Fix user accounts
Viewed 5313 times since Fri, Apr 19, 2019
Topics: PowerHA / HACMP, Storage Adding a new volume group to an active PowerHA resource group
Viewed 3240 times since Mon, Jun 3, 2019
LVM: Unmirror/Mirror "rootvg" Volume Group
Viewed 4203 times since Mon, May 21, 2018
AIX Cloning a rootvg using alternate disk installation
Viewed 12352 times since Sun, Jun 30, 2019
Replacing a failed disk (rootvg)
Viewed 3610 times since Mon, May 21, 2018
Kerberos, Active Directory and AIX
Viewed 7088 times since Mon, Jun 25, 2018
AIX Creating EtherChannel Devices from Command Line
Viewed 4645 times since Mon, Jun 3, 2019
Useful AIX general commands
Viewed 12842 times since Wed, Apr 17, 2019