Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 232413

Re: Get current alarms from vSphere with PowerCli or REST API

$
0
0

Ok, so I hacked this together. However, I cannot find how to get the information about if the alarm has been acknowledged or not..

 

Add-PSSnapin VMWare.VimAutomation.Core

 

Connect-VIServer "vcenter01"

$outputPath = "C:\data"

 

Get-VIEvent -Start (Get-Date).AddDays(-7) -MaxSamples ([int]::MaxValue) |

Where {$_ -is [VMware.Vim.AlarmStatusChangedEvent] -and ($_.To -eq "Yellow" -or $_.To -eq "Red") -and $_.To -ne "Gray"} |

Select CreatedTime,FullFormattedMessage,@{N="Entity";E={$_.Entity.Name}},@{N="Host";E={$_.Host.Name}},@{N="Vm";E={$_.Vm.Name}},@{N="Datacenter";E={$_.Datacenter.Name}} |

Export-Csv "$outputPath\alarms.csv" -noTypeInformation -Delimiter ";"


Viewing all articles
Browse latest Browse all 232413

Trending Articles



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