facing issue while creating setting value if having special charater and throwing error , is there any way to skip special characters in the output ?
action uses wow64 redirection {not x64 of operating system}
action parameter query “Output_Folder” with description “Please enter the Folder Name and Path” with default value “”
if { not exists (parameter “Output_Folder”)}
folder create {parameter “Output_Folder”}
endif
parameter “output”="{lines of file “output.txt” of folder (parameter “Output_Folder”)}"
setting “ActionOut”="{parameter “output”})" on “{parameter “action issue date” of action}” for client
update code but still getting same issue , looks like code is having issue with special characters which is there in the output.txt file , when i remove the special characters it creates the settings ??
action uses wow64 redirection {not x64 of operating system}
action parameter query “Output_Folder” with description “Please enter the Folder Name and Path” with default value “”
if { not exists (parameter “Output_Folder”)}
folder create {parameter “Output_Folder”}
endif
parameter “output”="{lines of file “output.txt” of folder (parameter “Output_Folder”)}“
setting “ActionOut1”=”{parameter “output”}" on “{parameter “action issue date” of action}” for client
Error:
Command failed (Missing 'on' keyword) setting "ActionOut1"="create the property ActionOut1asdfasdfsffasfasdfsa------------------------"Path": "\\\\srvat0045\\process(services)\\% processor time", " on "Thu, 28 Apr 2022 14:08:16 +0000" for client (action:12966)
I don’t think you’ll be able to apply that as a client setting, instead you should just read the output file as an Analysis property without trying to set it as a client setting.
thanks for your reply, if i set analysis then how i can get the latest data when i want to see the output from the analysis from a dynamic created folder as it may run at certain interval ? Is it possible to get the updated data at once ?
REST API does not expose the comments, but you can get to them using Query and passing the session relevance statement.
https://BigFixServer:52311/api/action/64543
No Comments.
This REST API query will show the comments:
https://BigFixServer:52311/api/query?relevance=(id of it, (name of author of it, text of it, timestamp of it) of comments of it) of bes action whose (id of it = 64543)
Thanks a lot for your Response - It some how solved the purpose.
But can you please confirm that is i have to update/add a new comment using action script how can we do that ?
@batra_d
I do not think there is a way to add comments from inside of an action script running on an endpoint.
I think adding comments is a Console Only feature.
If there is a way, I would love to learn about it.
Updating the Comments on a computer would require authenticating to the Bigfix Console, it’s not something a client should be doing.
For your use case, the best method is still to have your Action write to a file, and an Analysis read the file. You still need to be careful about the number of files you’re reading and the sizes of those files, as reporting them as Analysis properties is going to consume database size. For example 10 KB of file lines reported by ten thousand computers is going to add a hundred megabytes of text to the database.
That said, the basic form of the Action would be something like
folder create "{pathname of parent folder of parent folder of client folder of site "actionsite"}\script-output"
wait cmd.exe /c "run-something.cmd > "{pathname of parent folder of parent folder of client folder of site "actionsite"}\script-output\{id of action}.txt""
In the Analysis, you’d retrieve something like
Property: “Action Logs”
Relevance:
(name of it, lines of it) of files of folders "script-output" of parent folder of parent folder of client folder of site "actionsite"
The results would look like
1.txt, hello from action 1
2.txt, goodbye form action 2
Then from API you could use
values whose (it as string starts with "1.txt") of results whose (name of computer of it = "Computer1") of bes properties "Action Logs"
(to retrieve the results where the computer is “Computer1” and the action ID was “1”)
(the relevance for parent folder of parent folder of client folder of site "actionsite" can be made much simpler with things like ‘data folder of client’ and ‘storage folder of client’ but I still use the older form because it’s compatible to much earlier BES Client versions)
How frequent we should keep this analysis property update , as we need instance update once we execute the action ?
Secondly , if we use clientquery instead of analysis root then which one may be faster for 100s of server along with sequential / parallel execution’s ? as clientquery and cleitnqueryresults these two api we have to run to retrieve the results from client client and analysis is single API method.