I need a little help again...
I'm trying to create a custom alarm, that triggers when datastore usage goes too high.
We have an internal monitoring application that i want to trigger, and the easiest way i can do this, is by simply creating a file on the vCenter Server.
I've set the following:
And the script content:
cd /d "%~dp0"
If Exist "%LocalDir%\%VMWARE_ALARM_TARGET_NAME%_*.txt" (
Del /Q "%LocalDir%\%VMWARE_ALARM_TARGET_NAME%_*.txt"
If /I %VMWARE_ALARM_NEWSTATUS%==green (
Set VMWARE > "%LocalDir%\%OutputFile%"
However, it seems that nothing happens when the alarm gets cleared again.
That is, i'm expecting the script to actually delete all files related to a given datastore, and then skip creating a new one if the "alarm" is green.
But when the alarm clears, the script is not being run, apparently.
Looking at the options in the above screenshot, there's no "Red to Green" action, only "Yellow to Green". Could it be that simple?
I noticed that "..._OLDSTATUS" is always "Gray", no matter what the previous state was.
Any ideas or input is more than welcome.
If there's a smarter/simpler way of doing this, please do let me know. 🙂
Thanks a lot.