BigFix - How to specify that Action does not require a restart

I have a need to shutdown a server as part of my automation pipeline, so I’m using an API.

I am using this XML as a body to pass to the create action API, and all I’m doing is literally shutting down:

<?xml version="1.0" encoding="utf-8"?>
<BES xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" SkipUI="true">
    <SingleAction>
        <Title>Shutdown Action</Title>
        <Relevance>true</Relevance>
        <ActionScript>shutdown 30</ActionScript>
        <Settings>
            <PostActionBehavior Behavior="Shutdown">
                <AllowCancel>false</AllowCancel>
                <PostActionDeadlineBehavior>RunAutomatically</PostActionDeadlineBehavior>
                <PostActionDeadlineInterval>PT5M</PostActionDeadlineInterval>
            </PostActionBehavior>
        </Settings>
        <Target>
            <ComputerID>1234567</ComputerID>
        </Target>
    </SingleAction>
</BES>

I verify that my server does in fact shut down (so the action is completed), however, instead of the Status being set to “Completed” it is set to “Pending Restart” - is there a way to specify that a restart is not required for this action?

I also tried adding a “Shutdown” Post-Action in my XML to see if I can remove the “Pending Restart” status, but it did not do anything.

1 Like

I think that you working against BigFix in this use case. The action status won’t change to completed until the BF Client is running again, so it can report in. Perhaps you could create a custom action that simply runs the shutdown command via actionscript?

1 Like

Thanks that makes sense, I didn’t think about the BF client not reporting in.

I didn’t realize the format for the XML was messed up for my original post but I just fixed it - and I am actually using action script for the shutdown.

Sorry - I should have been clearer in my suggestion. You are using the shutdown command from actionscript, and what I meant to suggest was the OS’s shutdown command.

For example, in windows:

dos shutdown /s

I’m not sure how to specify this in the XML, but you should make the action’s success criteria the equivalent of:

“… all lines of the actions script have completed successfully”.

The client should have time to report back the actionscript line’s exit code, I think…:slight_smile: