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
How to Configure Sendmail not to Look up MX records
Viewed 3588 times since Fri, Apr 19, 2019
AIX Commands Related to Boot and Init Process
Viewed 4540 times since Tue, Apr 16, 2019
AIX: How to manage network tuning parameters
Viewed 3761 times since Mon, Jun 11, 2018
Mirroring session (TTY) on AIX using portmir
Viewed 9301 times since Thu, Feb 21, 2019
Tunneling With SSH to Your Destination
Viewed 4207 times since Wed, May 30, 2018
AIX WIKIS developerworks
Viewed 2331 times since Sun, Jun 17, 2018
Customizing a NIM Client Restore With a Post-Install Script
Viewed 10943 times since Wed, May 30, 2018
AIX: How to identify the program listening in the given port
Viewed 2406 times since Mon, Jun 11, 2018
AIX, Storage, System Admin↑ Identifying a Disk Bottleneck Using filemon
Viewed 9843 times since Fri, Apr 19, 2019
Trick to Purge/Clean Swap Usage on AIX
Viewed 7872 times since Thu, Nov 29, 2018