VMware Cloud Community
TimSamanchiLadb
Contributor
Contributor

Top ten triggered vCenter alerts

Hi all,

I have few vCenters and they are all configured with vCentrer SMTP alerts. Is there a way to get a list of top ten triggered alerts in the last month or defined period.

RegardsI 

0 Kudos
3 Replies
LucD
Leadership
Leadership

I assume that you mean the alerts generate SMTP traps, but we are talking about different alarms, meaning different triggers?

Since we will have to scan the Events History for this, are you sure you are keeping the Events history for at least a month?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
TimSamanchiLadb
Contributor
Contributor

Yes SMTP traps and I have event logging on the hosts enabled!

I just wanted to find out  - via a powerCLI command - which are the top ten SMTP alerts issued by the vCentrer in the past 4 weeks or something like that!

Thanks

0 Kudos
LucD
Leadership
Leadership

Try something like this

Get-VIEvent -Start (Get-Date).AddDays(-31) -MaxSamples ([int]::MaxValue) |

where{$_ -is [VMware.Vim.AlarmActionTriggeredEvent]} |

Group-Object -Property {$_.Alarm.Name} |

Sort-Object -Property Count -Descending |

select -First 10 |

Select Name,Count


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos