Hi All,
can i get Script for Getting the Active alarm list in the vcenter ?
Thanks,
Sankar R
Do you mean the "enabled" alarms or the alarms that were fired (triggered)?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
when i run the script, i should be able fetch the current alarm in the VC
That doesn't really answer my question, all enabled alarms or all triggered alarms?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I am looking for what are the Alarm recently generated and which is not turn to healthy. not sure that comes under triggered or enabled alarm.
Please assist me here
Thanks
Sankar
Ok, it seems you mean the triggered alarms.
One way of doing that is like this
$si = Get-View ServiceInstance
$alarmMgr = Get-View -Id $si.Content.AlarmManager
Get-Inventory | %{
$alarmMgr.GetAlarmState($_.ExtensionData.MoRef) |
where{[VMware.Vim.ManagedEntityStatus]::yellow,[VMware.Vim.ManagedEntityStatus]::red -contains $_.OverallStatus} |
Select @{N='Alarm';E={(Get-View -Id $_.Alarm).Info.Name}},
OverallStatus,
Time,
@{N='Entity';E={(Get-View -Id $_.Entity).Name}}
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hi,
If I just want to get alarm of vcenter in last 24 hours. Do you have any idea ?
Thanks
Then you would need to use Get-VIEvent and look at all AlarmStatusChangedEvent events.
Hence my original question if the requestor wanted to see the triggered alarms
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference