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: How to assign a specific PVID
Viewed 7624 times since Fri, Feb 1, 2019
AIX, user gets “pwd: The file access permissions do not allow the specified action.”
Viewed 11285 times since Tue, Mar 16, 2021
AIX snap - Prevent dump collection
Viewed 12348 times since Mon, Sep 17, 2018
AIX Commands Related to Boot and Init Process
Viewed 4735 times since Tue, Apr 16, 2019
AIX check the HBA status
Viewed 16757 times since Tue, May 22, 2018
Setup private yum repository for AIX clients
Viewed 11301 times since Thu, Feb 21, 2019
AIX oslevel version OS
Viewed 5020 times since Wed, Apr 17, 2019
AIX - How to monitor memory usage
Viewed 5594 times since Fri, Jun 8, 2018
Processes and Devices—It’s All About the Children
Viewed 2317 times since Wed, May 30, 2018
AIX FC Performance improvements for IBM AIX FC and FCoE device driver stacks
Viewed 5939 times since Fri, Jan 31, 2020