AIX: Script to create a file with commands to remove missing & 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 get IP and MAC address of ethernet adapter in AIX
Viewed 25695 times since Fri, Jun 8, 2018
Script HW/SW AIX
Viewed 9215 times since Mon, Jun 4, 2018
Topics: AIX, System Admin↑ Export and import PuTTY sessions
Viewed 3099 times since Fri, Apr 19, 2019
Restoring mksysb
Viewed 3585 times since Wed, May 30, 2018
List STALE partitions across Volume Groups for each Logical Volume in AIX
Viewed 2632 times since Tue, Jul 17, 2018
AIX Migrating from SDDPCM to AIXPCM (the easy way)
Viewed 20034 times since Mon, Dec 31, 2018
Awesome Command to show top 15 processes using memory on AIX
Viewed 23980 times since Thu, Nov 29, 2018
Burn Image to DVD in AIX
Viewed 13566 times since Thu, Sep 20, 2018
Problem on resizing volume group on AIX 0516-1714, 0516-792, 0516-787, and 0516-404
Viewed 2754 times since Fri, Jul 6, 2018
AIX - How to get Memory infomation
Viewed 10817 times since Fri, Jun 8, 2018