Automation

 View Only
  • 1.  Active Alerts Triggered in the vCenter

    Posted 11 days ago

    I am trying to get the currently triggered alerts in my vcenter server for vm, esxi, datastore or any alerts there in my vcenter. 

    Have tried multiple options but its not helping. 



  • 2.  RE: Active Alerts Triggered in the vCenter

    Posted 11 days ago

    You could do something like this

    Get-Inventory -PipelineVariable item |
    ForEach-Object -Process {
        $item.ExtensionData.TriggeredAlarmState |
        ForEach-Object -Process {
            $alarm = Get-View -Id $_.Alarm
            New-Object -TypeName PSObject -Property ([ordered]@{
                Name = $item.Name
                Type = ($item.GetType()).Name -replace 'Impl',''
                Alarm = $alarm.Info.Name
                Time = $_.Time
                Staus = $_.OverallStatus
            })
        }
    }


    ------------------------------


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


    ------------------------------