• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
ControlUp Community

ControlUp Community

Connect, Learn, and Grow

  • Blog
  • Podcast
  • Meetups
  • Archives
  • Categories
    • ControlUp One Platform
    • ControlUp for Apps
    • ControlUp for Compliance
    • ControlUp for Desktops
    • ControlUp Scripts & Triggers
    • ControlUp Synthetic Monitoring
    • ControlUp for VDI
  • Topics
  • Events
    • Logos & Wallpaper
    • ControlUp.com
  • Join

Leveraging ControlUp Triggers to Restart Services After VM Boot Up

Posted on December 7, 2023

A user asked about using ControlUp Triggers to restart a service after a VM boot up. Options discussed include Uptime in Minutes and Status column triggers, but it may be best to use a Scheduled Task in the VM. Advice was given to be careful with the equals operator, as it is risky for numeric values like uptime. A further suggestion was to use BIS-F with a custom script looping until the service is started.


Read the entire ‘Leveraging ControlUp Triggers to Restart Services After VM Boot Up’ thread below:

I’m trying to see if I can leverage ControlUP’s Triggers to restart a service after the VM boots up. I created a trigger to run a simple script when the uptime changes from 60 seconds, to 75 seconds. It never fires for some reason. I assume the monitors are scanning every 5 minutes or so…and missing the window of opportunity. It there a different way to go about this?


Correct, the monitors are on a 5 minute interval. When a agent disconnects the monitors wait until the next interval to attempt to reconnect.

You may be able to use Uptime in Minutes as a trigger.


I used Uptime in minutes as well. Nothing triggers. I really need a consistent way to ensure the service is restarted prior to user login.


It would have to be like greater than 6 to account for the 5 minute poll.

Another option may be the "Status" column.


UGH. OK. Scheduled Task in the VM it is… Thanks!


When Status = Ready.

Just FYI, in 9.0 agents will contact the monitors on start so should be alot quicker.


For the Status = Ready idea… you mean like this?


Yep!


in general be careful with the equals operator. Your trigger won’t fire unless:

• The previous state has the machine uptime at exactly 1 minute

• The next state has the machine uptime at exactly 1 min, 15 seconds.

It’s pretty rare for that scenario to happen. General tips in terms of triggers:

Previous state

Unless you actually care about the previous state, just leave the "from this state" selector empty. I’ve worked with CU daily for the last ~5 years and I think I’ve encountered a single good use case for the previous state. A trigger that only wants to do something when a user goes from idle > active. As in, the previous status is important to the functionality.

Equals operator.

The equal operator is risky for numeric values. Or volatile values. It is very useful for things like power status. But for metrics like uptime? You’re risking that you’re creating very specific scenarios you need to hit.

For uptime in particular. Remember that uptime is calculated (at least for agent based uptime, VM only data uptime is different) from the machines boot time, as determined by windows.

It could be that by the time the cuagent has started, uptime could already be at 2 minutes. Might be a bit extreme but you get my point.


Are we talking Citrix and are you using BIS-F by chance?

If yes, you can create a custom script for personalization phase which loops until the service is started.

Last thing BISF does is starting Broker Service so no users until that happens 🙂

Continue reading and comment on the thread ‘Leveraging ControlUp Triggers to Restart Services After VM Boot Up’.  Not a member? Join Here!


Categories: All Archives, ControlUp Scripts & Triggers
Topics: Automation & Alerting, Citrix, ControlUp Agent, Microsoft Windows, Scripts, Triggers

Ask Us Anything, Connect, Learn, and Grow with the ControlUp Community!

Login to the ControlUp Community to ask us anything, stay up-to-date on what’s new and coming soon and meet other like-minded techies like you.

Not already a member? Join Today!

Primary Sidebar

ControlUp Academy

Enroll in ControlUp Academy for expert-led technical training, equipping you with skills to effectively deploy, manage, and grow your ControlUp investment.

Learn here >

Rotating Images

Hidden Gem from our Community on Slack!

ControlUp Betas - What's Coming Next?
NEW ControlUp Features - Stay Up-to-Date!
ControlUp Scripts - Scripting, Zero to Hero
Latest KB Articles - Be the First to Learn
Did you Know - with Sivan Kroitoru
Practical Perspectives Technical Use Case Training

Video Tutorials Library

Visit our technical how-to videos, offering step-by-step tutorials on advanced features, troubleshooting, and best practices.

Watch here >

ControlUp Blog

Check out the ControlUp blog for expert advice and in-depth analysis.

Read here >

ControlUp Script Library

Visit the ControlUp technical script library, which offers a multitude of pre-built scripts and custom actions for your monitoring and troubleshooting requirements.

See here >

ControlUp Support

Visit the ControlUp support home and to delve deeper into ControlUp solutions.

Browse here >

Download ControlUp RealTime DX

Start with ControlUp for real-time end-user environment insights, swift troubleshooting, and unprecedented performance optimization. Download now.

Download here >

Footer

      

ControlUp Community
Of Techie, By Techie, For Techie!

Terms of Use | Privacy Policy | Security
Dive Deeper, Learn more at ControlUp.com

  • facebook
  • twitter
  • youtube
  • linkedin

© 2023–2025 ControlUp Technologies LTD, All Rights Reserved.

We use cookies to ensure that we give you the best experience on our website. by continuing to use this site you agree to our Cookie policy..