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
LVM: Extend an existing Volume Group by adding a new disk
Viewed 5796 times since Sat, Jun 2, 2018
AIX oslevel version OS
Viewed 5094 times since Wed, Apr 17, 2019
AIX, Storage, System Admin Allocating shared storage to VIOS clients
Viewed 2454 times since Fri, Apr 19, 2019
How to Use the Linux lsof Command
Viewed 11854 times since Sun, Jun 30, 2019
http://ibmsystemsmag.com/aix/administrator/backuprecovery/remote-sync/
Viewed 5508 times since Wed, May 30, 2018
AIX, Security, System Admin↑ Generating random passwords
Viewed 3153 times since Fri, Apr 19, 2019
AIX FC Performance improvements for IBM AIX FC and FCoE device driver stacks
Viewed 6085 times since Fri, Jan 31, 2020
IVM and VLAN Tagging
Viewed 10472 times since Mon, May 28, 2018
AIX boot proccess
Viewed 3252 times since Tue, Apr 16, 2019
Install and configure yum on AIX
Viewed 4782 times since Thu, Feb 21, 2019