The user asked for best practices when creating triggers in ControlUp and shared their own "findme" trigger for testing automated actions. This trigger is based on an active application title and can be used to fire the trigger when needed. They then covered the use of scheduled triggers for reboot schedules, with examples and providing a filter example with regex. Finally, a trigger for Wi-Fi signal strength, with an example of a created toast notification, was mentioned. Trigger Packs from ControlUp were also included in the post. The Trigger Packs link can be found at https://support.controlup.com/docs/trigger-packs.
Read the entire ‘Creating Triggers and Scheduled Reboots in ControlUp’ thread below:
I’d like to add more triggers to our environment for alerting. We share scripts, but not Triggers. Would anyone like to share some of your best Triggers with the community?
This isn’t really a production trigger. But I use it all the time to test automated actions. Because in automated action scenarios, the biggest problem waiting for the trigger to fire. I’m not very patient so I’d like to be able to fire a trigger when I want it to fire.
For those scenarios I use the "findme" trigger. Simply create a session based advanced trigger and set the trigger criteria to:
active application title is findme
I can then just open start > run > notepad findme.txt
Notepad will ask you if you want to create findme.txt. Click yes. The file isn’t actually important. The important bit is that you have something that you control (active window title) that causes your trigger to fire.
Want the trigger to fire again? Switch active application titles (IE switch to Chrome for a few seconds) and switch back.
Obviously you can’t use this if your users actually use applications that might have findme in the application title naturally. But I’d guess those scenarios are rare. And if that is a problem in your environment, just use anything else that is unique.
A few things to consider. Do set your "wait at least x time before repeating" to a low value. Else you can only fire the trigger once every 5 minutes (default).
I’ve been playing with using ControlUp to define reboot schedules using Scheduled Triggers. I think ControlUp can do it in a way much more powerfully than Citrix or others can do. I am going to work on making some templates available via community triggers but am interested in any thoughts others may have around what you do today or what you’d like to see.
You should be able to import these into your environment using the Import button in the Triggers dialog:
How they work:
The two triggers work on opposite "start" days. One is set for the 2nd, one for the 1st of October (when I started playing with this). For my reboot schedule they’ll execute every 2 days (configurable in the trigger for whatever time period you want)
The filter is where the more of the magic happens. The "Name is *[02468]$" is REGEX! You can enable RegEx in the filters by adding the asterisk character
The RegEx for the "even" reboot means that any machine that has it’s name ending in an even number (0,2,4,6 or 8 ) will have the script action executeFor odd the numbers are odd numbers in the square bracketsI also added "And Status equals to Ready" as this ensures the ControlUp Agent is functional on the machine so we are not trying to execute the action against "agentless" machinesYou then select the scope of the machines you want to execute against and the final part is "Run an action" which runs a script called "Restart Machine"
It runs a batch/command script that executes a single line:
shutdown -r -t 60 /c "ControlUp Scheduled Reboot" -f /d p:0:0
This tells the machine to reboot, with a delay of 60 seconds, recording the reboot as "ControlUp Scheduled Reboot", forcefully terminating applications and then specifying a reason as PlannedBy modifying the filter you can define complex reboot schedules. If you wanted to reboot 1/7th of your machines each day you could ‘duplicate’ the trigger and modify the filter to meet your needs. Instead of every 2nd day you can choose every 3rd, 4th, 5th, etc. Because ControlUp has scopes you can target specific machines and the like!Remember if you apply a new PVS image or MCS image as part of your reboots, you need to uses Citrix commands. If you do it any other way the image updates will not apply
Here another automation to alert your users when poor wifi is detected.
It will execute a session script action to create a toast notification on the users VDI. The trigger itself we defined as WiFi less than 75 but greater than 1. Needs to be greater than 1 as devices without Wifi report themselves as having "0" signal strength if I recall correctly:
If you can excuse the "Activate Windows" garbage, this is what that prompt looks like:
i’m hoping to implemet that on a new customer site tomorrow
I saw this thread and thought it would be good to add the ControlUp Trigger Packs to the thread. If you have not seen it, do take a look.
Trigger Packs
Trigger packs are compiled by ControlUp for out-of-the-box monitoring of your environments. You can download these trigger packs and import them into your ControlUp organization.
https://support.controlup.com/docs/trigger-packs
Continue reading and comment on the thread ‘Creating ControlUp Triggers and Scheduled Reboots in ControlUp’. Not a member? Join Here!
Categories: All Archives, ControlUp Real-Time DX, ControlUp Scripts & Triggers