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
bash for do done AIX
Viewed 1542 times since Mon, Jun 4, 2018
Find out which port the daemon is using on AIX OS. (similar like command netstat -anp for Linux)
Viewed 10805 times since Thu, Feb 21, 2019
AIX - How to get Memory infomation
Viewed 8559 times since Fri, Jun 8, 2018
replacing (hot-swap) failed disk in rootvg
Viewed 8657 times since Thu, Sep 20, 2018
How to Backup and Upgrade a Virtual I/O Server Part I
Viewed 4101 times since Wed, Jun 5, 2019
Altering LVM Configuration When a Disk is Not in ODM Anymore
Viewed 2685 times since Mon, Jun 3, 2019
AIX LVM QUORUM mysteries revealed
Viewed 2961 times since Wed, May 22, 2019
Managing System Dump Devices sysdumpdev
Viewed 3143 times since Mon, Jul 9, 2018
Using the AIX splitvg command
Viewed 3913 times since Mon, Jun 3, 2019
Changing ’defined’ or ’missing’ hard disk states to ’Available’ in IBM Smart Analytics System for AIX environment
Viewed 2168 times since Thu, Sep 20, 2018