VMware Cloud Community
Andrey_Luck
Contributor
Contributor

Powercli generate fake alarm

Hello, I would like test alarm 

Need to check:

  • vSphere UI Health Alarm", "Log disk exhaustion on vcenter name
  • Database Health Alarm", "Core and Inventory Disk Exhaustion on vcenter name

https://kb.vmware.com/s/article/82351

https://kb.vmware.com/s/article/76563

But, when i collectied all available event in vcenter:

$si = Get-View ServiceInstance
$evtMgr = Get-View $si.Content.EventManager
$evtMgr.Description.EventInfo | Out-GridView

Output have not any event related with vSphere UI Health Alarm, Database Health Alarm.

How i can generate fake alarm?

0 Kudos
1 Reply
LucD
Leadership
Leadership

I normally test alarms via the PostEvent method.
See for example How to generate alarms or events using any scripts... - VMware Technology Network VMTN

But in the case of the ResourceExhaustionStatusChangedEvent, the problem is that this one is not mapped in the PowerCLI framework.
So there is no easy way to create the event object.
A possible route could be to generate the event (by filling up the space on the /storage/log disk) and then retrieve it with Get-VIEvent.
Once you have that info, you could try to compose the object representing that event yourself.
Haven't tried that yet.

The EventManager only shows the basic set of events that come with vSphere.
Most Extensions (ExtensionManager) also have events.
But in this specific case, that event is not present in there either.


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

0 Kudos