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.
Pre-Requsites
Link to Script
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.
1#Define Variables 2$cred = Get-Credential 3$domains = "ucs01.lab.local","ucs02.lab.local" 4$Descr = "SNMP config for UCS" 5$AdminState = "enabled" 6$SysContact = "admin@lab.local" 7$SysLocation = "US" 8$Community = "public" 910#Cycles through each UCS setting values11Foreach ($ucs in $domains) {12 Connect-UCS $ucs -Credential $cred13 $servers = Get-UCSRackUnit14 Foreach ($server in $servers) {15 Set-UcsSnmp -Descr $Descr -AdminState $AdminState -SysContact $SysContact -SysLocation $SysLocation -Community $Community -force16 }17 Disconnect-UCS18}Execute the Script
- Run .\Set-UcsSnmpConfiguration.ps1
