
Community Archive (Customer) asked a question.
I would like to know if someone has written a script to monitor the paths for SAN LUNs on Windows or AIX hosts. I was hoping someone may have already done this work so I don't have to create our own custom scripts. In our environment we standardize on 4 paths to our storage array so ideally i would like to have a powershell script that checks for any disks with less than 4 paths. I've searched a bit on the web and found a basic PS one liner command which is nice for an interactive check of paths.
PS M:\> "hostname" | % { write-host $_ -ForegroundColor green ; (gwmi -ComputerName $_ -Namespace root\wmi -Class mp
io_disk_info).driveinfo | % {Write-host "Name: $($_.name) Paths: $($_.numberpaths)"}}
returns output like below:
hostname
Name: MPIO Disk0 Paths: 4
Name: MPIO Disk1 Paths: 4
Name: MPIO Disk2 Paths: 4
Name: MPIO Disk3 Paths: 4
We're also wanting to monitor AIX paths and I've written a one liner to count the Enabled paths.
bash-4.2$ for i in `lspv |grep -v None |awk '{print $1}'`; do printf " %-10s" $i; lspath -s Enabled |grep $i |wc -l; done
hdisk34 4
hdisk35 4
hdisk36 4
hdisk37 4
Any help would be appreciated.
Did you ever figure this out?