VMware Cloud Community
mtrohde
Enthusiast
Enthusiast

List of Email Alerts set in vCenter

I need to find a way to export a list of all alerts that have been set in vCenter.  I need to also know where they have been set, IE vCenter, Datacenter, cluster, folders, VMs, etc.  In particular I need to know what email address have been set for these alerts to notify.

Core issue is a former employee set some alerts to send emails, well they are gone but the alerts are still trying to notify them so I need to clean these out.

Regards,

Michael

Reply
0 Kudos
4 Replies
daphnissov
Immortal
Immortal

It's easiest to do this with PowerCLI, so you may want to post your question over there, or look around for a script.

Reply
0 Kudos
Marmotte94
Enthusiast
Enthusiast

Hi,

This is PowerCLI command as you need for set, show alarm in PowerCLI.

Thank you.

Olivier

Please, visit my blog http://www.purplescreen.eu/
Reply
0 Kudos
Marmotte94
Enthusiast
Enthusiast

Hi,

I propose for you this script. I had enough time to script at Lunch Smiley Wink

$Sendis = Get-AlarmAction | where {$_.ActionType -like "SendEmail"} | select @{l="To";e={$_.To -join ","}},ActionType,AlarmDefinition

$Output = New-Object psobject

$Output | Add-Member -MemberType NoteProperty -Name TO -Value $Sendis.To

$Output | Add-Member -MemberType NoteProperty -Name ActionType -Value $Sendis.ActionType

$Output | Add-Member -MemberType NoteProperty -Name AlarmDefinition -Value $Sendis.AlarmDefinition

$Output

Thank you,

Please, visit my blog http://www.purplescreen.eu/
Reply
0 Kudos
Marmotte94
Enthusiast
Enthusiast

Oups, sorry, For all alarm :

$ALLSendis = Get-AlarmAction | where {$_.ActionType -like "SendEmail"} | select @{l="To";e={$_.To -join ","}},ActionType,AlarmDefinition

foreach ($Sendis in $ALLSendis) {

$Output = New-Object psobject

$Output | Add-Member -MemberType NoteProperty -Name TO -Value $Sendis.To

$Output | Add-Member -MemberType NoteProperty -Name ActionType -Value $Sendis.ActionType

$Output | Add-Member -MemberType NoteProperty -Name AlarmDefinition -Value $Sendis.AlarmDefinition

$Output

}

Please, visit my blog http://www.purplescreen.eu/
Reply
0 Kudos