Hi,
I'm trying to create a script that sends an email with all of the daily alarms from VMware. I have it all done but the part that finds the object that is actually in alarm. I'm using the code below that I have seen in other similar questions, but I can't find anything in the SDK that will produce that object. I can only get it to point to the object where it is actually defined. Am I missing a property that will produce that or do I have to drill down to each individual object in inventory and check it for triggered alarms?
$vcenter = "vcntr01"
Connect-VIServer $vcenter
$datacenters = (Get-datacenter * | get-View)
foreach($datacenter in $datacenters){
foreach($triggered in $datacenter.TriggeredAlarmState){
$alarmDef = Get-View -Id $triggered.Alarm
Write-Host "$((get-view $alarmDef.Info.entity).name) $($alarmDef.Info.Name)"
}
}
Thanks!