Sunday, 15 December 2013

UPDATE: Get Total Disk Utilization Percent for Data ONTAP 7-Mode/C-Mode via PowerShell

Less than a week ago, I posted a script (here) to get the Total Disk Utilization Percent from a 7-Mode controller using Get-NaPerfInstance and Get-NaPerfData counters. Then, in the course of the week, I was made aware of a much easier way by which this data could be obtained using Invoke-NaSysstat. And it was so simple that I’ve posted two functions below, one that gets disk utilization percent for a 7-Mode controller and the other for a C-Mode Cluster.

## Get Disk Util 7-Mode

function getDiskUtil7 {

$sumDiskBusyP = 0
$stats = Invoke-NaSysstat -interval 1 -count 1 -disk *

foreach ($stat in $stats) {
     $sumDiskBusyP = $sumDiskBusyP + $stat.busy}

$avDiskBusyP = $sumDiskBusyP / ($stats.count)

return $avDiskBusyP}

## Get Disk Util Clustered ONTAP

function getDiskUtilC {

$sumDiskBusyP = 0
$stats = Invoke-NcSysstat -interval 1 -count 1 -disk

foreach ($stat in $stats) {
     $sumDiskBusyP = $sumDiskBusyP + $stat.busy}

$avDiskBusyP = $sumDiskBusyP / ($stats.count)

return $avDiskBusyP}

Image: Example using getDiskUtil7 (Disk util is 0% unsurprisingly since this is a SIM pulling no load!)


No comments:

Post a Comment