Multiple users discuss issues with scheduling triggers using various methods and provide tips for debugging triggers and creating debug logs. Additionally, they discuss the complexities of ControlUp’s scheduling logic and suggest ways to improve it. They also share the link to a helpful ControlUp script for creating debug logs.
Read the entire ‘Troubleshooting Scheduled Triggers in ControlUp’ thread below:
Has anyone else had any luck with getting scheduled triggers to work when you use a monthly schedule and assign the cadence by week and day? For example, I created a scheduled trigger yesterday to run for "Months: All", "Weeks: Third" (week 3) and "Days: Tuesday" (day 3). Based on that, the third Tuesday of this month would be February 18th, so this scheduled trigger should have executed on February 18th at 3:30 PM (see screenshot).
When I set the schedule like what’s in the screenshot, it never executed. When I changed it to use "Months: All" and "Days: 18", the scheduled trigger executed immediately at 3:30 PM.
I don’t mind using a specified date like the 18th in this example, however I’m hoping to achieve something like, "Run this scheduled trigger on the third Tuesday of every month."
Do you know how to enable debug logging on your monitors? If so:
• Prepare your trigger but do not commit the changes
• Enable debug logging on your monitor. Any monitor in the cluster should do. Log level should be debug.
• Save/commit (including clicking apply or okay in the settings screen) your trigger.
• Wait 30 seconds.
• Disable the debug logging
Read the log. It should contain entries with the logger ScheduledTriggersLogger. As in, if you search through the (probably reasonably large) log, you should see lines that contain ScheduledTriggersLogger. These should tell you what the monitor was thinking in terms of scheduling your trigger.
https://www.controlup.com/script-library-posts/deploy-log4net-for-controlup-processes/ can help you create debug logs.
Thanks @member, I will look into this so I can determine the issue with scheduling based on week/day.
Hi @member, I found something interesting in the debug logging for this. I created a test scheduled trigger with a start/effective time of 27/02/2025 00:00 (February 27th at 12:00 AM) and set it to All months on Week 1 Day 4.
Based on that, it should have determined that March 5th was the next eligible date for this schedule. However, it determined that April 2nd was the next eligible date.
See screenshot – filtered results in Notepad++ related to ScheduledTriggersLogger for the specific test trigger I created.
So I guess your previous trigger was potentially first scheduled to run a month later than expected?
That’s what I’m thinking. Also, I guess I don’t know how ControlUp is determining the logic of week/day. For instance, March 1st is this Saturday, so is that considered the only possible date for the first week of March or is it taking into account the first full week when using that kind of scheduling?
I feel like maybe it picked April 2nd because that date happens to fall on a Wednesday and is within the first week that April occurs on a calendar. By that same logic, March 5th is technically "week 2" instead of "week 1".
It would be nice if the scheduling process had built-in logic to determine that kind of scenario. If there’s no Wednesday during the week that March technically starts on (March 1, Saturday), then go to the following Wednesday instead of skipping the entire month.
The scheduling logic is quite involved. I’ll put something on my calendar to write it up. It’ll help you understand how it works.
Any chance you can export the trigger that caused this behavior?
Hi @member, I sent the exported trigger to you directly.
Continue reading and comment on the thread ‘Troubleshooting Scheduled Triggers in ControlUp’. Not a member? Join Here!
Categories: All Archives, ControlUp Scripts & Triggers