PM does not reboot - Suggestion

Automate Package Manager is a robust solution for MSPs seeking an efficient and streamlined approach to software management across diverse operating systems. With its cross-platform compatibility, integration with popular package managers like Chocolatey, Apt-get, Yum, and Homebrew makes it the go to choice for software update management.
Post Reply
frankbe
Posts: 52
Joined: Thu Jun 13, 2019 2:48 pm
6

PM does not reboot - Suggestion

Post by frankbe »

i can run a script with checks for reboot on linux os, but could you insert it in your update-script ?
An extra data field reboot if required yes/no and then reboot inside your script would be nice.

User avatar
Cubert
Posts: 2694
Joined: Tue Dec 29, 2015 7:57 pm
9
Contact:

Re: PM does not reboot - Suggestion

Post by Cubert »

CW Automate is a powerful tool and can do just about anything if you want it to. Here are several ways to automate reboots so that agents don't sit out there for weeks and months pending reboots.

I have written several post about automated reboots, here is one that provides some scripts and searches.

viewtopic.php?p=8972&hilit=reboot#p8972


There is also a built-in search called "Reboot Pending" which you can use to forces reboots when needed.

Screenshot 2025-03-04 092812.png
Screenshot 2025-03-04 092812.png (110.18 KiB) Viewed 1235 times

Let me explain further how to do this:

Using the search above you can create a process that reboots all agents reporting a reboot needed or you can make a copy of the Reboot Pending script and add extra tests to the search. Things like "OS Like Linux" or maybe only workstations excluding any servers. One of the tests I can't believe they did add to the original search, a test for "is agent currently online"

Why reboot an offline agent? So here is one of my modified searches.
Screenshot 2025-03-04 093854.png
Screenshot 2025-03-04 093854.png (9.18 KiB) Viewed 1235 times
You should make your searches repersent who and what should qualify them.

Make yourself a GROUP and assign the Search you created.

Now, lets create a group that will manage the agents that show pending reboots. In this new group we will assign our modified search and limit the group to the search. This is very important to get right. The reason we limit the group to the search is because the primary test of the search is that the agent must be pending a reboot. Once we reboot that agent, it will no longer be pending a reboot and so it should leave the group once its been rebooted. This prevents it from being rebooted over and over again as the group processes it's members.


Screenshot 2025-03-04 094218.png
Screenshot 2025-03-04 094218.png (26.54 KiB) Viewed 1235 times


We will need a reboot script that we can also modify to fit our needs. In my case a one liner is simple enough but you can add all sorts of things to this script that you can do as part of reboot. Options are endless.


Screenshot 2025-03-04 095133.png
Screenshot 2025-03-04 095133.png (18.65 KiB) Viewed 1235 times


Next, we add our script to our group and set the script schedule for every 2 hours. Why 2 hours? In my case, I want a machine that joins the group to be rebooted with in two hours and when agent returns from reboot, it is still joined to this group. We need to allow time for Automate to scan agent and clear the Pending Reboot flag, and then time to allow group to disjoin the agent as it no longer is in the search. This can take an hour with Automate so two hours seems to work well. You how-ever may only want to reboot agents after 11 pm in which your schedule would be set to daily and to run at 11:15 PM. Since script only runs once a day, your agent has plently of time to leave group after it returns from reboot.


Screenshot 2025-03-04 095602.png
Screenshot 2025-03-04 095602.png (41.92 KiB) Viewed 1235 times

frankbe
Posts: 52
Joined: Thu Jun 13, 2019 2:48 pm
6

Re: PM does not reboot - Suggestion

Post by frankbe »

Hi,
thank you for your answer.

I think sometimes it is better to do this right after the updates have been installed, So inside your script with an extra field for reboot yes/no it would make things easier.

Only a suggestion.

Post Reply

Return to “Automate Package Manager”