Vinicius Moyano (Partner) asked a question.

Powershell script for a Custom Performance Monitor of Cisco Memory Utilization.

In case you need to create a Custom Performance Monitor for Cisco Memory. Is serves to other brands as well, just need to replace variables.

 

ciscoMemoryPoolUsed (OID: 1.3.6.1.4.1.9.9.48.1.1.1.5)

ciscoMemoryPoolFree (Object ID: 1.3.6.1.4.1.9.9.48.1.1.1.6)

 

 

# Cisco Memory % Used — simple (0 decimal places)

 

$used = [double]$Context.GetReferenceVariable("ciscoMemoryPoolUsed")

$free = [double]$Context.GetReferenceVariable("ciscoMemoryPoolFree")

 

$total = $used + $free

$pct = if ($total -le 0) { 0 } else {

  [math]::Round((($used / $total) * 100), 0, [System.MidpointRounding]::AwayFromZero)

}

 

# Send value to the performance graph

$Context.SetValue([double]$pct)


Nichol Goldstein likes this.