PowerCLI – Remove SNMP Traps from vCenter Alarms

PowerCLI

You do not want to flood HP OpenView, Netcool or any other SNMP trap receiver with the out of the box vCenter alarms.

Ex. Cannot connect to storage

The script will ask for the vCenter name.   Log Insight show 30 alarms were reconfigured (not removed)

#  https://vmscribble.com/powercli/powercli-remove-snmp-traps-from-vcenter-alarms/
#  Tested on vCSA 6.7 

Write-Host " The PowerCLI script will remove sending of SNMP traps from all Alarms in the vCenter"

$vCenter = Read-Host "Enter the vCenter Name"

# Connect to your vCenter
Connect-VIServer $vCenter

# Remove the SNMP trap action
$TheAction = Get-AlarmAction -actiontype sendsnmp
Remove-AlarmAction -alarmaction $TheAction -Confirm:$false

# Disconnect from the vCenter
Disconnect-VIServer $vCenter -Confirm:$false