Forced Reboots via BigFix

I’ll admit I suck at relevance, I’m a sysadmin, not a developer. Do you have any examples I could reference for writing this relevance?

Thanks for all your assistance, much appreciated.

I tried the Restart commands as you suggested and am still getting mixed results. 2 of the 9 that I tried both of these on had to have the BES Client restarted in order for the reboot to take place. 1 of the servers that I happened to be logged on to had the BF dialog pop up on it and wouldn’t reboot until I clicked on Take Action.

I’m going to try this next.

if{0 < number of logged on users}
restart 30
else
restart 1
endif

1 Like

I just edited my above post with an easier option + screenshot.

What actionscript did you use that wouldn’t reboot until you clicked Take Action?

It should be that the number of seconds you specify is how long the user has to accept the reboot, otherwise it will just go. Perhaps restart 0 is unlimited time for the user to respond.

I do use actionscript like you just pasted in and I like it for handling reboots. One time out for users, a faster one if no users.

I had the prompt happen on the restart 10 only, not the restart 0. The script that I posted just seemed to ignore if anyone is logged in, which is what we want to do.

As to the schedule, I’ll give that a try and see how it works. Any other suggestions you might have would be greatly appreciated.

As to how we are going to do this, we have 200+ servers and we have them all tagged as being in certain Reboot Groups. So we will send down the monthly patches via a baseline in one Action and then send the reboot down scheduled in another action.

1 Like

Related:

So, I’m trying to get this setup to trial it using 1 day instead of 30 days, in the Run Only on Constraint selection, is the greyed out selections NOT selected or selected? For some reason I can’t upload a screen shot because I’m a new user here. My screen looks different that your screen shot so that’s why I’m a bit confused.

I believe greyed out means it is not selected.

You must check the box on the far left of “Run only on” in order for those to become selectable.

Well, this script worked in testing, but it’s not working across the board. Why can’t BigFix just reboot a device without any issues? This is basic functionality that I would expect to work. We scheduled a reboot for a server for 6 PM using the above script, all lines of the script show completed, however the action is showing a status of Pending Restart. The server never rebooted. I’ve had an open PMR with IBM on this for over a month now and they don’t understand what the issue is. Is anyone else experiencing this? If so, what is the work around?

If you think the issue is with BigFix, another option besides using the Action command “RESTART” is to issue a SHUTDOWN command to the OS.

DOS SHUTDOWN /R /F /T 0 /d P:0:0

This should cause your targeted systems to restart immediately and register that it was a Other (Planned) shutdown event, you can adjust the timing option as needed.

I strongly recommend to NOT call the OS shutdown commands from within actionscript as you may end up with a corrupted agent depending on how the OS does the shutdown. In most cases its probably OK but there are some large notable exceptions (AIX with a Hardware Management device is one)

2 Likes

We make the call to the OS to perform the reboot. If it doesn’t complete it there could be other issues with the endpoint preventing it, and also a status of Pending Restart doesn’t mean the endpoint DIDN’T restart, though in this case you said it didn’t restart.

Additionally if the client is busy when the 6pm time comes along and you give it a short timeframe to perform this restart, it may not be able to get to the action before it expires.

1 Like

I’ll give this a shot and see what happens. I want to say we’ve tried this already and it didn’t work either.
Thanks!

If this doesn’t work then its showing that BigFix isn’t able to do it because the OS can’t do it either. This command says restart no matter what… and we just pass the command directly to the OS to execute.

2 Likes

Do you know for sure that the system did not actually reboot? Also, it may not happen at exactly 6pm.

1 Like

I experienced a similar issue with executing an automatic reboot after a fixlet completed. The behavior was that console interaction was required to complete the reboot process. The answer is that GPO had “Interactive Logon: Do Not Require CTRL-ALT-Delete” set. https://support.microsoft.com/en-us/kb/938204

5 Likes

Maybe someone out there has recently experience this?
Using latest version of BigFix.

We run a baseline with 20 or so patches.
The server goes into pending restart
The server is unattended at all times
we created an action that does:
restart 180
the relevance is, if server belongs to a group and it is in pending start
we run the action for a day and hour in the future.
the action does not run just because the server is in pending start???

I can get it to work if instead of restart 180, the action reads DOS SHUTDOWN /R /F /T 0 /d P:0:0

is the conclusion then that restart 180 won’t work if the server is actually in pending start??

thanks.

The state of an action of “Pending Restart” may be due to the action just noticing that it needs a restart, to having already asked the user to restart the box and they aren’t replying. So it depends on how the action is written and how it was taken.

Doing a restart 180 with an existing pending restart waiting on the user will most likely wait for the first to be completed so you are in a bad state. Calling the OS to shutdown the system directly is not recommended as it hits the agent a bit harder and that action will also “fail” as it is shut down before it completes.

So the question is what the parameters given to the baseline were when it was taken? If the restart is requested did the operator choose to eventually force the restart?

1 Like

Your scenario sounds common - issue multiple patch baselines with no post-action restart, leaving them in ‘pending restart’ status, and then send a follow-up single action to trigger the restart. A lot of us use a workflow like that and you should be able to get it working.

There are two different ways for an action to get into ‘pending restart’ state.

If you have an action that needed a restart to complete, i.e. the action contains action required restart "my patch update", but you did not configure a post-action restart, the action status will remain “pending restart” until the reboot occurs.

Likewise, if you configure a post-action restart in the action settings (or use the restart actionscript command), the status will be “pending restart” until the reboot occurs; and the bes client will trigger the restart user interface with the countdown options you specified.

One action’s “pending restart” action would not prevent you from sending other actions to restart the client. Exception: if the bes client is already trying to restart the system, it will not execute other actions. This is after any restart countdown timer, when the reboot should actually be happening.

I know of at least two conditions that can trigger a restart problem.

IF you use the post-action settings or ‘restart 180’ command, the client will try to launch the client UI to display the countdown timer. On Windows Core systems, or systems with logged-on but disconnected Remote Desktop sessions, the client may not trigger the restart because it cannot present the user interface. See Post-Action Restart problem for details and a client setting to handle that condition. I believe there was also something in the release notes of one of the recent client versions about restart handling on Server Core installations.

What version is your bes client, what version is your operating system, and are you running on core? Can you post entries from the client log where it is failing to restart?

2 Likes

hello and thank you for your continuous help, yes it seems that the pending restart was in place not because of the current baseline but because other external situations. I just run the scenario with two different servers were the pending start was not true to start with, run the baseline and then the action and everything happen as it should.

I will test with more boxes and let you know, but it seems that is working.

thanks.

1 Like

Can anybody help me write the proper ActionScript which will mimic the UI generated by the PostAction tab when taking an action?

Example: I have a task which is simple: restart 180.
I put that into a baseline with some relevance to know when a restart is needed.

I’d like the ability to add to the ActionScript of the task so that a dialogue box is displayed giving an end user the ability to cancel the restart.

Right now if I push the baseline without defining anything on any tab when taking the action, they get a dialogue box with the ability to restart sooner than 3 minutes, and a countdown timer, but the “Cancel” button is greyed out so they cannot cancel the action.

Can I activate that cancel button somehow inside the ActionScript of the task?

I use a right click option that force restarts when needed. The shell command is"shutdown -m \\"&hostname of current computer &" -r -f"