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
Script HW/SW AIX
Viewed 9064 times since Mon, Jun 4, 2018
n a perfect world....rootvg would always reside on hdisk0
Viewed 2243 times since Thu, Jun 6, 2019
How to check dual path in AIX
Viewed 13819 times since Fri, Jun 8, 2018
Getting list users and groups in AIX
Viewed 3528 times since Mon, May 28, 2018
How to upgrade TL and SP in AIX using alternate disk(alt_disk_copy)
Viewed 11463 times since Sun, Jun 30, 2019
Configuring an AIX client with multiple Kerberos realms
Viewed 8899 times since Mon, Jun 25, 2018
Part 2, Detailed diagnosis and troubleshooting
Viewed 2789 times since Tue, May 22, 2018
VIO Server Howto
Viewed 10071 times since Mon, Jun 11, 2018
How to know witch process is running in a particular port on AIX using KDB
Viewed 12625 times since Thu, Nov 29, 2018
AIX - How to get CPU infomation
Viewed 5525 times since Fri, Jun 8, 2018