Users discussed options to set up a trigger to run an action and if that action fails, run a different one. The ControlUp trigger packs include a trigger that alerts when machines go unregistered, followed by a script action to reboot the machine. Members suggested creating two triggers or using Invoke-cuaction to programmatically run actions and determine if a VM needs to be rebooted. The support document containing more information is available at https://support.controlup.com/docs/trigger-packs?highlight=triggers#citrix
Read the entire ‘How to Set Up Fail-safe Actions with ControlUp Triggers’ thread below:
Is there a way to setup a trigger where it runs a action and if that action fails then run a different action? At times I have machines go un-registered and then I run the "Restart Citrix Desktop Service" and if it fails to run that I want to have it reboot the VM.
We do have a trigger in our trigger packs that looks for unregistered machines, alert you, then you can add a script action to reboot the bad machine after X amount of mins.
https://support.controlup.com/docs/trigger-packs?highlight=triggers#citrix
You basically have 2 options.
Option 1, like Clint suggested
Create 2 triggers.
Trigger 1 – machine is unregistered for 5 minutes. This would attempt to restart the Citrix Desktop Service
Trigger 2 – machine is unregistered for 10 minutes. This would restart the machine at the hypervisor level
Option 2, invoke-cuaction
Invoke-cuaction can programmatically run actions. Those can be built-in admin actions (like restart/reset a VM) or script actions. You also get action results.
You would write a trigger that says machine is unregistered for 5 minutes. That trigger would use invoke-cuaction to attempt to restart the Citrix Desktop Service. You’d then use the values returned by that action to determine if you need to reboot the VM.
Continue reading and comment on the thread ‘How to Set Up Fail-safe Actions with ControlUp Triggers’. Not a member? Join Here!
Categories: All Archives, ControlUp Scripts & Triggers