Powershell script for EMC unity capcity monitoring

I am preparing a powershell script to export the unity capacity pool details to a csv file. Need a loop to export all the pool details to csv file. The loop should read the used space and total space from the below output. The two pools details needs to be copied two lines in the csv file with pool names and corresponding used space and remaining space and total space. Could anyone kindly help


1:    ID                   = pool_1
      Name                 = test POOL
      Total space          = 15726559625216 (14.3T)
      Remaining space      = 5425885872128 (4.9T)
      Subscription percent = 148%
      Number of drives     = 25
      RAID level           = 5
      Stripe length        = 5
      Rebalancing          = no
      Health state         = OK (5)
      FAST Cache enabled   = no
      Protection size used = 0
      Non-base size used   = 0

2:    ID                   = pool_4
      Name                 = music Pool
      Total space          = 42507291328512 (38.6T)
      Remaining space      = 22079084691456 (20.0T)
      Subscription percent = 351%
      Number of drives     = 45
      RAID level           = 5
      Stripe length        = 5
      Rebalancing          = no
      Health state         = OK (5)
      FAST Cache enabled   = no
      Protection size used = 225889239040 (210.3G)
      Non-base size used   = 225889239040 (210.3G)

#script

$names = @(
"test.unity.com"




# ... 
) 


$arrays = @()
foreach ($name in $names) {
#$system=uemcli -d 10.1.1.1 -u Local/admin -p password1/sys/general show
#echo $system


$arrays1 = uemcli -d $name -u Local/admin -p password! /stor/config/pool show 

echo $arrays1


 $name=($arrays1| Select-Object -Property Name )

 echo $hostname1


} 

Answer

Attribution
Source : Link , Question Author : Aravindsarasamma , Answer Author : Community

Leave a Comment