Quantcast
Channel: VMware Communities : All Content - All Communities
Viewing all articles
Browse latest Browse all 175326

Triggered Alarm Object

$
0
0

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!


Viewing all articles
Browse latest Browse all 175326

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>