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
0 (0)
Article Rating (No 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 Resolving "missing" or "removed" disks in AIX LVM
Viewed 2979 times since Tue, Aug 6, 2019
How to Analyze or Read OS Watcher Output in three easy steps -- With Example ?
Viewed 15987 times since Thu, Jun 21, 2018
LVM: Shrink & extend a filesystem/volume
Viewed 1461 times since Sun, Jun 3, 2018
Configuring an AIX client with multiple Kerberos realms
Viewed 7225 times since Mon, Jun 25, 2018
AIX - How to monitor CPU usage
Viewed 18673 times since Fri, Jun 8, 2018
Script to make mksysb backup from NIM to LPAR
Viewed 2577 times since Thu, Feb 21, 2019
Backup and Restore With AIX
Viewed 3224 times since Sat, May 19, 2018
IBM AIX MPIO: Best practices and considerations
Viewed 7944 times since Wed, May 30, 2018
View mksysb content & restore individual files
Viewed 1162 times since Tue, Jul 17, 2018
Topics: AIX, System Admin↑ Export and import PuTTY sessions
Viewed 1979 times since Fri, Apr 19, 2019