To do a quick check on the number of path present (does not mean all are Enabled] using for loop

To do a quick check on the number of path present (does not mean all are Enabled] using for loop.
=====================================================


for i in `/usr/sbin/lspath | grep scsi | awk  '{print $2}' | sort |uniq ` ;  do echo "$i `/usr/sbin/lspath | awk '/'$i' /' | uniq | awk '/Enabled/' | wc -l`" ; done

for i in `/usr/sbin/lspath | grep scsi | awk '{print $2}' | sort | uniq` ;  do echo "$i `/usr/sbin/lspath | awk '/'$i' / {print $2}' | wc -l`" ; done


hdisk0        2
hdisk1        2
hdisk2        2
hdisk3        2
hdisk4        2
=====================================================

 

The below command will use lspath to identify number of path configured and number of those path which are online
=====================================================
echo "Dev         NoPath    Online     ThroughNoOfInterface" ; for i in `lspath -H -F 'name parent path_id connection status' | awk '!/name /  {print $1}' | sort | uniq`; do echo "$i; `lspath -H -F 'name parent path_id connection status' | awk '/'$i' /{print $4}' | uniq | wc -l`; `lspath -H -F 'name parent path_id connection status' | awk '/'$i' / && /Enabled/ {print $4}' | uniq | wc -l`;        `lspath -H -F 'name parent path_id connection status' | awk '/'$i' / {print $2}' | uniq | wc -l`" ; done


Dev         NoPath    Online     ThroughNoOfInterface
hdisk0;        1;        1         1
hdisk1;        1;        1         1
hdisk2;        3;        1         1
hdisk3;        3;        1         1
hdisk4;        3;        1         1
=====================================================

 

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
Useful AIX commands
Viewed 11294 times since Sun, Jun 17, 2018
7 Tips – Tuning Command Line History in Bash
Viewed 7068 times since Fri, Jul 5, 2019
0516-787 extendlv: Maximum allocation for logical volume error
Viewed 10505 times since Tue, Mar 12, 2019
How to setup an user in AIX
Viewed 5600 times since Mon, May 28, 2018
Transform XML to CSV Format | Unix String Pattern Manipulation The Ugly Way
Viewed 8142 times since Sun, Jan 9, 2022
AIX rootvg Mirroring
Viewed 5968 times since Mon, May 21, 2018
AIX - How to get network speed and statistic of ethernet adapter in AIX
Viewed 16987 times since Fri, Jun 8, 2018
Part 2, NFS monitoring and tuning
Viewed 7687 times since Mon, Jun 4, 2018
How do I analyze and debug core files on AIX
Viewed 8601 times since Thu, Feb 21, 2019
AIX: Script to create a file with commands to remove missing & failed paths
Viewed 4120 times since Tue, Jun 12, 2018