Is there any documentation for the ActionResult status values? I found this link for the status of each individual computer (Action state code documentation) but im just looking for the status values of the overall action (I have seen Open/Expired). Im trying to figure out a simple way to figure out if all the computers are done processing (regardless of whether they succeeded or not). Does an Action become Expired once all Computers are fixed or is the only way to check their individual states?
An action only becomes expired when it reaches its expiration, not when all computers are fixed.
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âŚ
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.
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