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
Convert JSON to CSV with bash script
Viewed 11684 times since Mon, Jan 20, 2020
SSH Essentials: Working with SSH Servers, Clients, and Keys
Viewed 3987 times since Wed, Jun 27, 2018
LVM: Shrink & extend a filesystem/volume
Viewed 1927 times since Sun, Jun 3, 2018
Online Backups and Recovery in a Snap AIX
Viewed 4625 times since Wed, May 30, 2018
AIX: Error code 0516-1339, 0516-1397 0516-792: cannot extendvg with a previous Oracle ASM disk
Viewed 3379 times since Wed, Feb 6, 2019
vfcpmap on VIO Server
Viewed 9204 times since Tue, Jun 4, 2019
AIX Errpt - Diag - Alog
Viewed 3312 times since Wed, Mar 20, 2019
Finding password rules in AIX
Viewed 2419 times since Mon, May 28, 2018
Script to download TL and SP for AIX using NIM and SUMA
Viewed 8788 times since Thu, Feb 21, 2019
AIX, Monitoring, Networking, Red Hat, Security, System Admin↑ Determining type of system remotely
Viewed 1989 times since Fri, Apr 19, 2019