Action Exit Correct buy Status failed

Hello, still trying to figure this BigFix thing and the ability to run actions and task
the following action does exactly what it needs to do and the exit value is 0 however as you can see in the picture the status of the action is failed?
Checked and remove as many “strange” characters as possible but still no joy.
Any suggestions will be appreciated.

delete “c:\tmp\output.log”
action parameter query “commandtorun” with description “Please enter stop - start - restart - query - queryandfix”
if {parameter “commandtorun” of action != “”}
if {parameter “commandtorun” of action = “stop”}
wait cmd.exe /c echo “{parameter “commandtorun” of action as string} is good” >> “c:\tmp\output.log”
else
wait cmd.exe /c echo “{parameter “commandtorun” of action as string} is NOT GOOD” >> “c:\tmp\output.log”
endif
else
wait cmd.exe /c echo “the value for ApplicationToRun cannot be blank” >> “c:\tmp\output.log”
endif

Thanks @juliocesarperez17 for raising this. I was about to post it.

I too have experienced the same with shell script, where command executed and performed what it was supposed to perform. Could see the command succeeded in Log as well. But Status of the action on console is “Failed” with exit code “0”.

I would appreciate if anyone can share the insight on this.

It will depend on a few things how a “failed” is determined.

Ignoring the complexity of a Custom Success Criteria, a fixlet must go non relevant (its targeting relevance needs to go false) and a task must complete all lines of the action successfully.

An action that is running when the client is restarted (or the OS is restarted) will also fail by default as the interruption of the action is considered a failure.

Custom success criteria can change all that but its a much more complex case and may not be involved here.

many thanks for the reply Alan, My task restarts the client which partially explains my initial question. But, there are tasks to restart BES Client released by BES Support, but they never fail with the scenario in discussion.

PS: No success criteria is used.

Hello AlanM, I understand about the complexities of success or failure of an action/task, however in the specific action listed in this question, can you point out the reason why will the result be listed as failed?

thanks.

If you restart with an actionscript command or the post action setting then a failure won’t happen as that’s AFTER the action completes. If you put an OS command to restart, that is when the issue happens.

You would have to provide the actual log so we can see what failed on the endpoint. So many things can fail but the log usually indicates exactly what.

Hi Alan, it was an agent restart not a server restart. Will provide you the log soon.

If the agent is restarted during the execution of an action, the action will fail except for a specific case where the last line is a client restart command which I notice is missing from the https://developer.bigfix.com/action-script/reference/ location but an example is in BES Support fixlet 1976

Hello Alan…the log reads…
At 08:30:52 +0100 -
GatherHashMV command received.
At 08:30:56 +0100 - mailboxsite (http://MSHUAAR001.ms.mears:52311/cgi-bin/bfgather.exe/mailboxsite14042578)
Downloaded ‘http://MSHUAAR001.ms.mears:52311/mailbox/files/fb/9a/fb9a906b1597dc66df5b0a95fd401af7de691310’ as 'Action 273.fxf’
Gather::SyncSiteByFile adding files - count: 1
At 08:30:56 +0100 -
Successful Synchronization with site ‘mailboxsite’ (version 188) - 'http://MSHUAAR001.ms.mears:52311/cgi-bin/bfgather.exe/mailboxsite14042578
Processing action site.
At 08:30:59 +0100 - mailboxsite (http://MSHUAAR001.ms.mears:52311/cgi-bin/bfgather.exe/mailboxsite14042578)
Relevant - LM_Recycle_EI_EIG_Latest (fixlet:273)
At 08:30:59 +0100 -
ActionLogMessage: (action:273) Action signature verified for Execution
ActionLogMessage: (action:273) starting action
At 08:30:59 +0100 - actionsite (http://MSHUAAR001.ms.mears:52311/cgi-bin/bfgather.exe/actionsite)
Command succeeded delete “c:\tmp\output.log” (action:273)
Command succeeded action parameter query “commandtorun” with description “Please enter stop - start - restart - query - queryandfix in lower case” (action:273)
Command started - wait cmd.exe /c echo “start is good” >> “c:\tmp\output.log” (action:273)
At 08:31:05 +0100 -
Report posted successfully
At 08:31:05 +0100 - actionsite (http://MSHUAAR001.ms.mears:52311/cgi-bin/bfgather.exe/actionsite)
Command succeeded (Exit Code=0) wait cmd.exe /c echo “start is good” >> “c:\tmp\output.log” (action:273)
At 08:31:05 +0100 -
ActionLogMessage: (action:273) ending action
At 08:31:05 +0100 - mailboxsite (http://MSHUAAR001.ms.mears:52311/cgi-bin/bfgather.exe/mailboxsite14042578)
Not Relevant - LM_Recycle_EI_EIG_Latest (fixlet:273)
At 08:31:12 +0100 -
GatherHashMV command received.
At 08:31:21 +0100 - CustomSite_MEARS_1 (http://MSHUAAR001.ms.mears:52311/cgi-bin/bfgather.exe/CustomSite_MEARS_1)
Downloaded ‘http://MSHUAAR001.ms.mears:52311/bfmirror/bfsites/manydirlists_15/__diffsite_99316daea530a41f7e3cddaea0561a59d2dc23f0_to_961cc96ada94bed0d2ff9d76556e8651995d940f’ as '__TempUpdateFilename’
Gather::SyncSiteByFile merging files - count: 1
At 08:31:22 +0100 -
Successful Synchronization with site ‘CustomSite_MEARS_1’ (version 646) - 'http://MSHUAAR001.ms.mears:52311/cgi-bin/bfgather.exe/CustomSite_MEARS_1
Processing fixlet site.
At 08:32:39 +0100 -
Report posted successfully

Based on these lines the action completed successfully and did its work so not sure why you are seeing failed. If there is no custom success criteria then the original relevance went “false” based on the “Not Relevant” line and that is a success.

Thank you Alan, is there anything I need to do in order for the action to be a success?

I appreciate your help.

I suppose you are using “Fixlet” and I think the easiest way would be to create new “Task” with same action script.
If you want to keep it as “Fixlet”, then either 1) as Alan has suggested, change relevance of your Fixlet so that it gets false after action script commands has completed, or 2) edit your Fixlet in following way

  1. Open Actions tab
  2. Check “Include Custom Success Criteria” and click “Edit…”
  3. Select “…all lines of the action script have completed successfully”.
  4. Click “OK”, Click “OK”

Something as simple as that, once I created the action as a task, the status when to completed and the exit value to 0. Thank you for your help.