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
AIX, Security, System Admin↑ Generating random passwords
Viewed 3842 times since Fri, Apr 19, 2019
AIX How to Investigate a System Reboot
Viewed 8254 times since Tue, Aug 14, 2018
AIX snap - Prevent dump collection
Viewed 13081 times since Mon, Sep 17, 2018
How to enable Large Pages for a specific user on AIX?
Viewed 3721 times since Thu, Nov 29, 2018
AIX - How to get CPU infomation
Viewed 7295 times since Fri, Jun 8, 2018
Trouble Shooting AIX Networking
Viewed 3429 times since Tue, May 22, 2018
Useful AIX general commands
Viewed 13318 times since Wed, Apr 17, 2019
How to deal with performance monitoring in AIX ?
Viewed 8645 times since Fri, May 25, 2018
Useful AIX commands
Viewed 11096 times since Sun, Jun 17, 2018
Script to reset NIM state and deallocate resources
Viewed 3235 times since Thu, Feb 21, 2019