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

ControlUp Community

Connect, Learn, and Grow

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

How to set a ControlUp Trigger with multiple schedules?

Posted on December 8, 2022

Users discussed finding a clean way to set a trigger with multiple schedules for monitoring Horizon services. It was suggested to use a PowerShell script with IF logic for this. To prevent getting emails when the server closes for patching, a maintenance window could be set, with a different action taken if the service is down for more than 30 minutes. ControlUp’s Realtime DX can be used to set a custom schedule. An example script was provided, which requires the user to edit it with the event IDs they want to monitor for and any services to be excluded. This thread can be added to the FAQ page.


Read the entire ‘Finding a Clean Way to Set Trigger with Multiple Schedules for Horizon Services’ thread below:

Anyone find a clean way to set a trigger with multiple schedules? For example.

Do X when the trigger fires during business hours

Do Y when the trigger fires after business hours

Do I need to set up two triggers and point each one to the appropriate schedule?


the best bet would probably be a powershell script that includes the IF logic. @member or @member – what do you guys think?


actually its a bit more complex.

The trigger monitors for Horizon services to stop or crash. We get flooded with emails when the server goes down for patching. If i set a maintenance window, then I won’t get notified if the service is still down after patching and reboots complete.


i was hoping to make a different action during the maintenance window: IE: the service is down for more than 30 min.I have a script that does similar


It will check all the services specified and write an event if it’s stopped and set to automatic. Then it will read the events over the last X time and see if the service is still stopped. If so if will attempt restarting it and if it fails multiple times to start then it will throw an errori like it, care to share it>


Let me track it down one min


Okay apparently I lost it but I should be able to remake it pretty quicklyI’ll do it now 🙂@member with "it will read the events over the last X time…" are you talking abt the Events pane in ControlUp Realtime DX?

Because by default the events will be rolled over every 60 mins so there is no good history available 😄

@member if this maintenance window is already known you should be able to create a custom schedule for that trigger 🙂


yes, midnight to 6am is the maintenace


It will be the event logs on the machines and it will need to be a scheduled trigger and an accompanying trigger to read event logs, after I finish this we can setup a call if you want to talk about it


It’s pretty straight forward, kind of a way to abuse our tool to create functionality that doesn’t currently exist 🙂If you need a trigger which doesnt run at a specific time you can create a custom schedule.

The picture below shows a schedule which runs 7-12pm.


Okay so the way the script works right now is it puts everything that’s automatic but stopped into an info event (first pic) Then it reads that info event every 30 minutes (or whatever specified) to see if it’s still stopped. If they are still stopped it will generate an error event which you can trigger off of (Pic 2)

Additionally you can set the time you want and the event IDs in the script and also exclude services you do not want to see (pic 3)


Thanks Steve, I have a couple of other companies that could take advantage of these scripts!


thx!! so i need to find the event IDs i want to monitor for and edit the script?


I’m looking at the builtin VMware Horizon Connection Server Events trigger. I’ll work to translate that to the script you provided.


this is a useful thread!


add to the FAQ page

Continue reading and comment on the thread ‘How to set a ControlUp Trigger with multiple schedules? ‘.  Not a member? Join Here!


Categories: All Archives, ControlUp for VDI, ControlUp Scripts & Triggers
Topics: Automation & Alerting, Logs, PowerShell, Scripts, Triggers, Virtual Desktops, VMware, VMware Horizon, VMware Horizon View

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

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 DEX solutions.

Browse 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–2026 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..