AIX: Script to create a file with commands to remove missing & 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 determine why your AIX oslevel is downlevel (and a script to help!)
Viewed 5620 times since Fri, Jul 13, 2018
AIX HA / HACMP, System Admin↑ Mountguard
Viewed 8630 times since Mon, Jun 3, 2019
LVM: Extend an existing Volume Group by adding a new disk
Viewed 6477 times since Sat, Jun 2, 2018
NMON nmon
Viewed 13409 times since Tue, Apr 16, 2019
Rootvg Mirroring in AIX
Viewed 3733 times since Mon, May 21, 2018
Technology level update on AIX using smit_update and alt_disk_install method
Viewed 6978 times since Sun, Jun 30, 2019
Topics: AIX, System Admin↑ Export and import PuTTY sessions
Viewed 3899 times since Fri, Apr 19, 2019
10 AIX Commands to Add to Your Toolbox
Viewed 6071 times since Sat, May 19, 2018
SNAP
Viewed 2716 times since Mon, Sep 17, 2018
Script to make mksysb backup from NIM to LPAR
Viewed 4341 times since Thu, Feb 21, 2019