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
Secure Secure Shell
Viewed 9269 times since Fri, Aug 21, 2020
Convert to Scalable Volume Groups
Viewed 3044 times since Wed, May 30, 2018
AIX: Script to create a file with commands to remove missing & failed paths
Viewed 1927 times since Tue, Jun 12, 2018
Using Kerberos security with Server for NFS
Viewed 8047 times since Wed, Jun 27, 2018
AIX Assign a PVID to a new hdisk
Viewed 5706 times since Tue, Jul 17, 2018
LVM: Unmirror/Mirror "rootvg" Volume Group
Viewed 2708 times since Mon, May 21, 2018
How to Use the Linux lsof Command
Viewed 9659 times since Sun, Jun 30, 2019
Monitor logfiles and command output on AIX using multitail.
Viewed 1621 times since Thu, Feb 21, 2019
AIX, Security, System Admin↑ Generating random passwords
Viewed 2209 times since Fri, Apr 19, 2019
AIX NFS Version 4 configuration over Kerberos inter-realm setup
Viewed 2423 times since Wed, Jun 27, 2018