Create a Schedule to Reboot host at a specified interval / Resolves the Take Action "Creep" Issue

(imported topic written by DrSonnyNnamchi)

Folks,

Problem:

We have a known issue within BigFix at a customer that a scheduled “Custom Take Action” expected to run between 4:00AM and 6:00AM in the morning , also set to be reapplied indefinitely (in this case a reboot) on hosts at a particular time (Say 4:00AM) every day or after a 24-hour of last Action seems to “creep” because it is using the actual restart time or last time the system was rebooted to make a prediction of when it should be executed, thus we were seeing the reboot executed several forward times within the interval like at 4:06AM / 4:13AM / 4:21AM etc until the “Run Between” Upper Limit is ( say 6:00AM) is eventually exceeded (Thus the creep issue). The Action continues to run after this upper interval is exceeded. and this was unacceptable. A simple schedule to perform the reboot at a particular time of the day, everyday was not possible within BigFix using its default custom take Action settings.

Fix:

Applicability relevance scripting was used to successfully get the needed reboot to execute within the acceptable time interval (such as 4:00AM and 4:10AM), thus making it run the action script ( of rebootaction) ONLY within the time interval (say 4:00AM to 4:15AM) of “Relevance”, but it checks that the system has been up for more than 8mins (uptime of operating system) as part of relevance evaluation and that the time interval is within the specified time prior to taking the reboot action.

Here is the Applicability script:

(uptime of operating system as string > “
00:08:00
”) AND (((preceding text of last “:” of (substring separated by " " whose (it contains “:”) of (now as string))) >= “
0
4:00
”) AND ((preceding text of last “:” of (substring separated by " " whose (it contains “:”) of (now as string))) <= “
0
4:09
”))

I hope this helps someone out there.

Sonny N

(imported comment written by JasonWalker)

That does look helpful, but on a slow or busy client, or on a client with a lot of active content, you might miss the reboot altogether because the action doesn’t happen to process during your small window. I’d consider extending your “acceptable time interval”.

I think your relevance check on the time could be simplified a bit as well…

(uptime of operating system > 2 * hour)

AND

(time of current time_of_day > (“04:00:00” as time_of_day))

AND

time of current time_of_day < (“06:00:00” as time_of_day)

Also, I think you can tweak the Action Settings. If you set the Action to “Run only between 04:00 and 05:30”, Reapply whenever it becomes relevant again, and change the Relevance to only

(uptime of operating system > 2 * hour)

then I think this would accomplish what you want.

(imported comment written by jgstew)

I agree with Jason, there seems to be an easier answer, and part of the problem is using “actual restart time or last time the system was rebooted” to predict the time the system should restart. There are built in ways to handle this in the take action dialog that can be combined with relevance like Jason suggests.