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
Checking HBA status on AIX
Viewed 20220 times since Fri, Oct 5, 2018
HOWTO: Copy a filesystem on AIX
Viewed 3310 times since Mon, May 28, 2018
AIX: Script to create a file with commands to remove missing & failed paths
Viewed 4202 times since Tue, Jun 12, 2018
AIX Commands Related to Boot and Init Process
Viewed 6277 times since Tue, Apr 16, 2019
Processes and Devices—It’s All About the Children
Viewed 3471 times since Wed, May 30, 2018
AIX smtctl The smtctl command controls the enabling and disabling of processor simultaneous multithreading mode.
Viewed 16569 times since Fri, Jan 18, 2019
Firmware Assisted Dump sysdump
Viewed 3190 times since Mon, Jul 16, 2018
Backing up your VIOS configuration with viosbr.
Viewed 13059 times since Mon, May 28, 2018
ILMT Procedure - ILMT / TAD4D / SUA / BFI
Viewed 11330 times since Fri, Jul 5, 2019
AIX, Security, System Admin↑ Generating random passwords
Viewed 3940 times since Fri, Apr 19, 2019