Timely machine restart

raskand95
New Contributor

Dear Community!

 

I am having a hard time finding a solution for scheduled machine restarts. I have plenty of mac devices in my fleet and my users tend not to restart their machines once in a while so I wish to set a two week / 1 restart schedule for instance every second week wednesday 17:00 in the afternoon - so they dont come complaining that they are out of memory and their machines are slowing by the day. 

Does anyone have any ideas on how to do this? I even wish to have a countdown and a notification to save everything because your machine will automatically reboot in 30 minutes (for instance). 

 

Is this possible to do in Jamf? 

 

Thank you in advance!

David

2 ACCEPTED SOLUTIONS

TheAngryYeti
Contributor II
Contributor II

you have a few options here.  

first would be a config profile that has a startup/shutdown schedule - yet you can't provide options to the end user here.

next would be a policy that has just the restart options configured to your liking with the timer - the policy can have a recurring timeline for execution and also be limited to running at certain times of day via server/client side limitations in the policy - you can also configure user deferral for this.

another would be a policy that runs the restart command(or a script) with a user deferral message/timeline similar to the above options.

 

View solution in original post

cgssi
New Contributor II

I use a rebranded IBM notifier app for this.
I have a policy that is scoped to machines with 13 days uptime which presents the user with a pop up as show here: https://monosnap.com/file/sRPTun0eiLg7ctJM8XxsuCP7m4gBFQ 
The policy is a command line with parameters and underneath that i just run shutdown -r +5 which will auto restart the machine after 5 mins.


View solution in original post

10 REPLIES 10

TheAngryYeti
Contributor II
Contributor II

you have a few options here.  

first would be a config profile that has a startup/shutdown schedule - yet you can't provide options to the end user here.

next would be a policy that has just the restart options configured to your liking with the timer - the policy can have a recurring timeline for execution and also be limited to running at certain times of day via server/client side limitations in the policy - you can also configure user deferral for this.

another would be a policy that runs the restart command(or a script) with a user deferral message/timeline similar to the above options.

 

sigrun
New Contributor

Hi, 

I guess you can make a policy:
In the Computers pane -> Policies -> New Policy -> Restart Options. Select whatever is appropriate for your fleet.


In the "user interaction" pane under you can set the deferral type to "duration" and set the number of days you want.

A warning message should pop-up to users. 

Back to the General pane:

I belive "Recurring Check-in" would be the right trigger. However, I am not sure how to get this to run every Wednesday, but you can make the policy run once a week, once a month in the "Execution Frequency" option. 
Also it might look like you can tick off the rest of the days in the week you DON'T want the policy to run in the "client-side limitation". (I have not tested this pane myself, so I would try before pushing it out.) 

Hope this points you further on to the goal!  

 

cgssi
New Contributor II

I use a rebranded IBM notifier app for this.
I have a policy that is scoped to machines with 13 days uptime which presents the user with a pop up as show here: https://monosnap.com/file/sRPTun0eiLg7ctJM8XxsuCP7m4gBFQ 
The policy is a command line with parameters and underneath that i just run shutdown -r +5 which will auto restart the machine after 5 mins.


@cgssi this is a great way to do this.  I like what you did there.

ZachWC
New Contributor II

Do you know if/how that could be setup with an interactive deferal?

cgssi
New Contributor II

You could initially set it to run the policy but allow the user to decide if they reboot or not. Give them two buttons to click "Restart Now", "Restart Later". With Restart Later you could end the script or use it to kick off a delay of your choosing

DodsonNY
New Contributor II

I'm not really understanding how to assign actions to the buttons.  This is the use case I'm looking at also - just a basic restart now/restart later option.  Is there documentation I'm missing?

AJPinto
Honored Contributor III

I have a policy to force reboot devices with a 1 day deferral targeting devices with a 7day up time. If the reboot comes at a bad time users can bump it back 1 day. Since its targeting uptime, custodial users that reboot on their own never see this policy run. I am not too concerned as to when the policy triggers due to the deferral option users have, but you could configure a policy not to run in certain time windows.

Hi AJPINTO!

 

Could you please share the process (if you allowed to share) this kind of method would do good for me. Thank you! 

AJPinto
Honored Contributor III

Sure, the nuts and bolts are below.

 

  • Extension attribute that reads a devices uptime
  • Smart group that is looking for the uptime to be greater than 7 days
  • A policy targeting that 7 day uptime group to issue a FileVault auth reboot
    • The policy has a 1 day user deferral in the user interaction tab

 

Extension Attribute:

#!/bin/sh

dayCount=$( uptime | awk -F "(up | days)" '{ print $2 }' )

if ! [ "$dayCount" -eq "$dayCount" ] 2> /dev/null ; then
    dayCount="0"
fi

echo "<result>$dayCount</result>"

exit 0