Hi,
we have a vmware 6 cluster with vCenter but we never enabled the e-mail alerts to be notified about downtime or other stuff going wrong
Now we would like to do that through vCenter but when I see all the default alarms we see 158 alarms where apparantly I have to set all the e-mail notification per alarm. Is that the only way or is it possible to set the e-mail notification to an e-mail address for all the alarms at once?
Regards,
Bram
Sorry about the delay. Something like the below should do the trick. Make sure you test first / snapshot prior to making the changes.
This should result in the following configuration and yep, you can go ahead and modify via the GUI after configuring with PowerCLI.
Connect-VIServer vCenterServer
$Alarms = Get-AlarmDefinition
foreach ($Alarm in $Alarms){
$Alarm | New-AlarmAction -Email -To 'email@domain.com'
$Alarm | Get-AlarmAction | New-AlarmActionTrigger -StartStatus 'green' -Endstatus 'Yellow'
$Alarm | Get-AlarmAction | New-AlarmActionTrigger -StartStatus 'Red' -Endstatus 'Yellow'
$Alarm | Get-AlarmAction | New-AlarmActionTrigger -StartStatus 'yellow' -Endstatus 'green'
}
Hi Bram,
This can be done in an automated way via PowerCLI. I will post an example in a couple of hours when near the computer. Do you want to be alerted on all status changes (green > yellow, yellow > red, red > yellow and yellow > green), or only some?
Cheers, Matt.
Hi Matt,
first of all thanks for offering your assistance!
What I would like is an alert (email) on every status change so if that can be done that would be excellent! And if I would like to change only one or a few afterwords, is that still possible through the Web client?
Regards,
Bram
Sorry about the delay. Something like the below should do the trick. Make sure you test first / snapshot prior to making the changes.
This should result in the following configuration and yep, you can go ahead and modify via the GUI after configuring with PowerCLI.
Connect-VIServer vCenterServer
$Alarms = Get-AlarmDefinition
foreach ($Alarm in $Alarms){
$Alarm | New-AlarmAction -Email -To 'email@domain.com'
$Alarm | Get-AlarmAction | New-AlarmActionTrigger -StartStatus 'green' -Endstatus 'Yellow'
$Alarm | Get-AlarmAction | New-AlarmActionTrigger -StartStatus 'Red' -Endstatus 'Yellow'
$Alarm | Get-AlarmAction | New-AlarmActionTrigger -StartStatus 'yellow' -Endstatus 'green'
}
Thanks for your help, worked like a charm and saved me soooo much work
Have a good one!
Regards,
Bram