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
Setup private yum repository for AIX clients
Viewed 12531 times since Thu, Feb 21, 2019
Convert CSV to JSON with bash script
Viewed 6267 times since Mon, Jan 20, 2020
Monitor logfiles and command output on AIX using multitail.
Viewed 3300 times since Thu, Feb 21, 2019
Removing Failed or Missing Paths
Viewed 4875 times since Wed, May 30, 2018
Many Choices for AIX File Integrity
Viewed 3707 times since Wed, May 30, 2018
How to know witch process is running in a particular port on AIX using KDB
Viewed 13908 times since Thu, Nov 29, 2018
Check connection (rsh or nimsh) between NIM server and LPAR
Viewed 12513 times since Thu, Feb 21, 2019
AIX routing - How Do I Compare ODM with the Current Routing Table?
Viewed 4731 times since Mon, Jul 29, 2019
LVM: Extend an existing Volume Group by adding a new disk
Viewed 6729 times since Sat, Jun 2, 2018
Find out which port the daemon is using on AIX OS. (similar like command netstat -anp for Linux)
Viewed 13473 times since Thu, Feb 21, 2019