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, Networking Etherchannel failover testing
Viewed 2511 times since Fri, Apr 19, 2019
AIX: How to set automatic logoff (only for terminals)
Viewed 2967 times since Mon, Jun 11, 2018
Create jfs2 logical volume on AIX
Viewed 4674 times since Thu, Feb 21, 2019
Part 2, NFS monitoring and tuning
Viewed 6322 times since Mon, Jun 4, 2018
Software management in AIX
Viewed 6748 times since Mon, Jun 25, 2018
AIX Health Check basic
Viewed 4362 times since Fri, Jun 8, 2018
Managing System Dump Devices sysdumpdev
Viewed 3377 times since Mon, Jul 9, 2018
R2dump debug tool
Viewed 2078 times since Tue, Sep 8, 2020
Problems with NFS on an AIX Reboot? Then Go Single
Viewed 7106 times since Wed, May 30, 2018
Finding password rules in AIX
Viewed 2591 times since Mon, May 28, 2018