i am using below code to fetch the vc alerts. i would like to add below two variables in existing code.
variables
VMWARE_ALARM_EVENTDESCRIPTION
VMWARE_ALARM_ALARMVALUE
foreach ($dc in (Get-Datacenter | where { $_.ExtensionData.triggeredAlarmState })) {
foreach ($alarmState in $dc.ExtensionData.TriggeredAlarmState) {
$entity = Get-View $alarmState.Entity -Server $vcenter | Get-VIObjectByVIView
$alarm = Get-View $alarmState.Alarm -Server $vcenter
$event = Get-VIEventPlus -Entity $entity -EventType AlarmStatusChangedEvent -Start $alarmState.Time -Finish $alarmState.Time.AddSeconds(1)
$alarmState | select @{N = 'vCenter'; E = { $vcenter = $dc.Uid.Split('@:')[1]; $vcenter } },
@{N = "Entity"; E = { $entity.Name } },
@{N = "Alarm"; E = { $alarm.Info.Name } },
@{N = 'Description'; E = { $alarm.Info.Description } },
@{N = 'Previous State'; E = { $event.From } },
@{N = 'New State'; E = { $event.To } },
@{N = 'Message'; E = { $event.FullFormattedMessage } },
Time, OverallStatus
}
}