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
Migrating from SDDPCM to AIXPCM (the easy way)
Viewed 2547 times since Mon, Jun 3, 2019
SSH-COPY-ID on AIX. SSH remote AIX’s box without password
Viewed 16751 times since Thu, Feb 21, 2019
SNAP
Viewed 1954 times since Mon, Sep 17, 2018
7 Tips – Tuning Command Line History in Bash
Viewed 5204 times since Fri, Jul 5, 2019
HMC: HMC and LPAR management commands
Viewed 7119 times since Sun, Jun 3, 2018
A tcpdump Tutorial and Primer with Examples
Viewed 5018 times since Sun, Jun 17, 2018
AIX, Installation, NIM↑ Creating an LPP source and SPOT in NIM
Viewed 14753 times since Fri, Apr 19, 2019
Useful AIX commands
Viewed 9503 times since Sun, Jun 17, 2018
AIX LVM QUORUM mysteries revealed
Viewed 3285 times since Wed, May 22, 2019
HOWTO: Copy a filesystem on AIX
Viewed 2438 times since Mon, May 28, 2018