Using UCS PowerTool To Set SNMP Configuration

Published on March 1, 2016 under Cisco · Tagged Cisco UCS, SNMP and Powershell · Read in about 1 min (137 words)

Time for more UCS Scripting! This time to enable SNMP. The script is pretty straightforward, but nice to have to easily set up SNMP across multiple UCS domains.


Preparing to Execute the Script

The script is pretty straight forward, just need to define a few variables seen below and then you execute the script. I will walk you through the process.

#Define Variables
$cred = Get-Credential
$domains = "ucs01.lab.local","ucs02.lab.local"
$Descr = "SNMP config for UCS"
$AdminState = "enabled"
$SysContact = "[email protected]"
$SysLocation = "US"
$Community = "public"

#Cycles through each UCS setting values
Foreach ($ucs in $domains) {
  Connect-UCS $ucs -Credential $cred
  $servers = Get-UCSRackUnit
  Foreach ($server in $servers) {
    Set-UcsSnmp -Descr $Descr -AdminState $AdminState -SysContact  $SysContact -SysLocation $SysLocation -Community $Community -force

Execute the Script

  • Run .\Set-UcsSnmpConfiguration.ps1
Share this post
comments powered by Disqus

See Also