Automation

 View Only
  • 1.  Datastore Folder Alarm

    Posted Dec 02, 2022 08:26 PM

    I need a script to create an alarm for a specific datastore folder in the storage view (e.g. datastore-1000gb) under a specific Datacenter (e.g. Datacenter-1).
    The alarm will have 2 alerts generating a warning at 80% utilization and critical at 90% utilization, and email to a specific email address (alert@email.com) and also a snmp trap. I don't have a specific script in mind except the one I found here: https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/powercli-script-to-create-datastore-alarms/td-p/1751880. It's from 2017. Can it be modified to fit my ask? I'll sincerely appreciate that. Thanks.



  • 2.  RE: Datastore Folder Alarm
    Best Answer

    Posted Dec 02, 2022 10:20 PM

    There are a number of cmdlets to create and change Alarms, but the requirements you specify are unfortunately afaik not possible.
    Similar to the thread you linked to, you can use the API method.

    Something like this for example



  • 3.  RE: Datastore Folder Alarm

    Posted Dec 04, 2022 11:47 PM

    Hey Thanks so much as usual! I'll definitely test this out and let you know how it goes.



  • 4.  RE: Datastore Folder Alarm

    Posted Dec 25, 2022 04:42 AM

    Thank you . This works very well.