ActionResult Status Values

An action only becomes expired when it reaches its expiration, not when all computers are fixed.

1 Like

You can use the REST API or session relevance to figure out the individual states of machines that are affected by an action. I can put up an example a little later for you if you need guidance.

Actually, this information is available straight up in the console, one level deeper than the overall status of an action (open/expired).

I can retrieve those within the current action status from the API, I was more looking for the full list of states for the action itself (Open/Expired/Stopped) like there was in the above link for the action when run against each individual computer so I can properly figure out the overall action state and the individual computer states.

I thought these possible values would be in the latest doc, but I couldn’t find them there (I’ll poke the doc folks about this)

The 8.1 version of the console operator’s guide has the values:
http://support.bigfix.com/product/documents/Tivoli_Endpoint_Manager_Console_Operators_Guide_81.pdf

Starting on page 30:

 Running: The Action is currently running.
 Evaluating: The Action is still evaluating its relevance.
 Failed: The Action has failed to run correctly.
 Cancelled: The user has canceled the Action.
 Download Failed: The Action failed to complete the download.
 Locked: The computer is locked and cannotcannot run the action.
 Offers Disabled: Offers cannot be presented on the specified client, so the Action will never run.
 Waiting: The Action is waiting on a user response.
 Pending Downloads: The Action is waiting on downloads.
 Pending Restart: The Action is waiting for a restart from the Client computer.
 Pending Message: The Action is waiting for the user to accept the Action message.
 Pending Login: The Action is waiting for the user to log in for a user-assisted Action.
 Pending Offer Acceptance: The Action is waiting for the user to accept the offer.
 Constrained: The Action has been constrained by a Relevance statement set in the Execution
tab of the Take Action Dialog.
 Expired: The Action has passed its expiration date.
 Postponed: The Action has been postponed by the Client.
 Invalid Signature: The Action cannot run due to an invalid signature.
 Not Relevant: The Action is not relevant on this Client.
 Not Reported: The Action has not reported its success or failure.
 Error: The Action has resulted in an error.
 Fixed: The Action has completed, resolving the issue.

Since 8.1 there could have been additional action statuses added to these (I’ll bug doc folks to update these too), but those are a pretty solid list to get you started.

These are two different things. Action State refers to the action itself, not to any computer results, and has values like Open, Stopped, or Expired. Expired refers to “the designated end time of the action has passed”, nothing to do with whether computers ran the action.
Action Results refers to reported results from computers for the action, and can be things like Completed, Failed, Fixed, Pending Restart, etc.

Both can be queried via Session Relevance, using the ‘bes actions’ inspector.

In the console, the action will show a computer count as well, in the form X/Y, where X is the number of successes, and Y is either the total target count (for actions targetted by specific computers) or the count of computers that reported Relevant (if targetted dynamically by property or group).

Ah ok, I misread this forum post. If we’re looking for what the action result possibilities are, we’ve had this question asked before:

You can do a query against bfEnterprise to figure out what the possible action states are. The table you want is dbo.actionstatestrings.

Hi @dexdexdex, great, thank you, this is what I was looking for. It does appear to have changed as its missing ‘Open’ as a status.

I posted a couple of Session Relevance queries that might be helpful at bigfix.me -

Status of all Open Actions
http://bigfix.me/relevance/details/2999679

Results of Open Actions
http://bigfix.me/relevance/details/2999680

I pulled a list of all action status and I actually dont get ‘Fixed’ as a result for any of them (for the overall action) which is a bit odd although the individual computer action status match the dbo.actionstatestrings.

$ grep 'Status' action_stats | sed  's/^[ \t]*//' | sort | uniq -c
1242 <Status>Action has failed and is waiting before trying again.</Status>
31 <Status>A required download failed.</Status>
336 <Status>Evaluating relevance and action constraints.</Status>
7966 <Status>Expired</Status>
5232 <Status>Invalid action content: the action script contains a syntax error.</Status>
1 <Status>Invalid site context. The Fixlet site may no longer exist.</Status>
395 <Status>Open</Status>
46 <Status>Stopped</Status>
62795 <Status>The action executed successfully.</Status>
3780 <Status>The action failed.</Status>
77 <Status>The action is currently running.</Status>
8 <Status>The download size exceeds the maximum value set in the client setting _BESClient_Download_PreCacheStageDiskLimitMB, which can be modified through the Edit Computer Settings dialog.</Status>
131908 <Status>The Fixlet which this action addresses is not relevant on this machine.</Status>
2237 <Status>This action expired before it could be executed.</Status>
8 <Status>Waiting for downloads to be mirrored.</Status>
1818 <Status>Waiting for restart to complete action.</Status>
10708 <Status>Waiting on action dependency.</Status>
1751 <Status>Waiting to run in specified time range.</Status>
3 <Status>Waiting to satisfy temporal distribution time constraint.</Status>
1327 <Status>Waiting until the action start time.</Status>

I’m suprised to see these values all thrown in together, but admittedly I don’t do much with direct SQL queries. The results you’re getting look like they correspond to both “states of bes actions” and to “statuses of results of bes actions”.

They werent thrown together, sorry for the confusion there, that was me. I just dumped all the /api/action/<id>/status for all actions into one file using the API. So its a mix of overall action status and individual computer action status but regardless by the counts and results it obviously doesnt look right if no result out of about 8k+ is returning an overall ‘Fixed’ state as prior docs show.

I have seen both “Fixed” and “Completed” as results of statuses of bes actions; I’m not sure whether that’s because I’m running a mix of client versions between 8.2 and 9.2; or Windows and Linux; or it may be that Fixlets and Tasks may give different success results as well.

I really hope thats not the case because the array of options here is already confounding as it is on how to handle them through automation as fail/no fail vs running/not running. So much for the good old days of just using exit codes.

I just checked, and we’re both sort-of right. In the Console, browsing the Action and looking at computer results, I see “Completed” but when I do a Session Relevance query against the same action result, I get back a status of “Fixed”.

I’ve found other actions where the status in the Console is “Fixed”, those also report “Fixed” through Session Relevance.

So I see both “Completed” and “Fixed” in the Console, but both cases report as “Fixed” through Session Relevance. I haven’t yet discerned a pattern to “Completed” versus “Fixed” in the console; I’m seeing those with both Linux and Windows, with Single Actions and with Baselines, and with Fixlets and Tasks.

Let me try explaining this better because what Im seeing still doesnt match any of the above explanations.

All Im working with is whats coming out of the REST API (not using the console at all), I have no idea what relevance type that is.

I call /api/action/<id>/status and get this:

<?xml version="1.0" encoding="UTF-8"?>
<BESAPI xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="BESAPI.xsd">
<ActionResults Resource="https://localhost:52311/api/action/72682/status">
	<ActionID>72682</ActionID>
	<Status>Expired</Status>
	<DateIssued>Mon, 20 Oct 2014 14:23:35 +0000</DateIssued>
	<Computer ID="9319855" Name="Test-IEM-patches">
		<Status>The Fixlet which this action addresses is not relevant on this machine.</Status>
		<State IsError="0">0</State>
		<ApplyCount>0</ApplyCount>
		<RetryCount>0</RetryCount>
		<LineNumber>0</LineNumber>
	</Computer>
</ActionResults>
</BESAPI>

We have at least one (/BESAPI/ActionResults/Status) or more (//BESAPI/ActionResults/Computer/State) action states that describe the overall status.

For /BESAPI/ActionResults/Status I have dumped all my available actions and the only statuses I get are Expired, Open, or Stopped based on the previous stats I pasted, but not all of these values are in the above documented values so I want to know what are the full set of values for this field.

For //BESAPI/ActionResults/Computer/State it matches what is referenced in dbo.actionstatestrings except for instances where its supposed to probably be a negative value (this might be an integer overflow bug with the API or the docs are missing possible states):

<Computer ID="15856558" Name="computer">
    <Status>Invalid action content: the action script contains a syntax error.</Status>
    <State IsError="1">4294967290</State>
    <ApplyCount>1</ApplyCount>
    <RetryCount>1</RetryCount>
    <LineNumber>23</LineNumber>
    <StartTime>Sat, 23 Aug 2014 22:01:36 +0000</StartTime>
    <EndTime>Sat, 23 Aug 2014 22:01:37 +0000</EndTime>
</Computer>

$ grep 'IsError="1"' action_stats | sed  's/^[ \t]*//' | sort | uniq -c
5232 <State IsError="1">4294967290</State>
1 <State IsError="1">4294967293</State>

Are we expected to reverse the overflow based on IsError and will IsError properly be set for the other error states that are non negative?

Number of ActionStatus-ComputerID pairs:

SELECT COUNT(*)
  FROM [BFEnterprise].[dbo].[BES_ACTIONS]

Number of Completed/Fixed Actions: (Fixed seems to be the only successful status)

SELECT COUNT(*)
  FROM [BFEnterprise].[dbo].[BES_ACTIONS]
  WHERE ActionStatus LIKE 'Fixed'

This might be what you are looking for:

SELECT distinct cast(ActionStatus as varchar(max))
  FROM [BFEnterprise].[dbo].[BES_ACTIONS]

Results:

<error>
Action Files in Use
Constrained by Action Dependency
Constrained by Active User Condition
Constrained by Client Setting __BESClient_Download_MinimumDiskFreeMB
Constrained by Date Range
Constrained by Distribution Time
Constrained by License
Constrained by Retry Delay
Constrained by Time Range
Download Failed
Download Hash Mismatch
Evaluating
Expired before execution
Failed
Fixed
Invalid Action Signature
Locked
Not Relevant
Pending Offer Acceptance
Restart Cancelled by User
Restart Waiting for User Input
Running
Transcoding Error
User Cancelled
Waiting for Downloads
Waiting for Restart
Waiting for User Input

References:

http://support.bigfix.com/download/bes/misc/BESDatabaseAPIReference-7.0.pdf

Thats another way of retrieving the values for //BESAPI/ActionResults/Computer/Status which is the same as dbo.actionstatestrings but those values are not what corresponds to /BESAPI/ActionResults/Status which is not documented anywhere and was what I was really hoping to find as in some cased one would not have to check the individual status of all computers for the action but the overall action status.

According to support the ‘Expired’, ‘Open’, or ‘Stopped’ values are the only values for /BESAPI/ActionResults/Status but im not sure how accurate that is…

1 Like

Those are the only action states I’ve seen. The more detailed status are always results reported from each client.

You might be able to emulate something like the percent-complete displayed in the console, but that would still be based on individual reported computers.

1 Like

To get the “overall status” of a particular action, you could use something like

(multiplicity of it, it) of unique values of (statuses of results of bes actions whose (id of it = 480520) as string)

which yields results like
108, Fixed

or

1, Fixed
2, Pending Downloads

or

1, Failed
8, Fixed
1, Not Relevant
1, Pending Downloads

Here’s another one that I use in one of my custom dashboards. I have a Javascript that replaces the “statuses of results of it” depending on which type of results I’m looking for; in this example, I only look at Actions that have at least one “Failed” result… You may be able to remove all of my HTML formatting and do something useful with this.

In the Console, this can run in the Presentation Debugger using the HTML view as-is:

/* Header Row */
(
b of “ID” as html,
b of “Link” as html,
b of “Issuer” as html,
b of “Site Name”,
b of “time issued” as html,
b of “time expired” as html,
b of “results” as html
);
/*Result Rows - must match data type of Header Row so cast “as html” */
(
id of it as string as html,
link of it,
name of issuer of it as html,
(if exists (names of sites of source fixlets of it) then name of site of source fixlet of it else “”) as html,
time issued of it as string as html,
(if exists expiration time of it then expiration time of it as string else “”) as html,
concatenation “;” of (multiplicity of it as string & " " & it & " " as html) of unique values of (statuses of results of it as string)
)
of bes actions whose (state of it = “Open” and (if exists parent group of it then state of parent group of it = “Open” else true) and exists (statuses of results of it) whose (it as string = “Failed”) )

1 Like