Target computer in action script

Hello,

I would like to know if there is a way to use a parameter in action script which contain the target computer where this task is currently executed?

Something like:
run blablabla.exe <target_name>

Thanks.

Are you trying to have the action script use the variable on what exe to run,or targeting the computer?

My first post message was truncated …
Yes I need to use the variable inside the action script

run blablabla.exe target_computer

I’m guessing this is what your fishing for.

action parameter query "TargetComputer" with description "Who do you want to hit?"
run cmd.exe /c "blablabla.exe {parameter "TargetComputer"}"
1 Like

You could also (as they just want to know the name of the computer in question do

run cmd.exe /C "blablabla.exe {hostname}"

Hello,

Thanks for your answer. Just another question …

The bigfix script will be executed on the target host or on the big fix server?
My goal is to run it on the big fix server …

Actionscript is always run on the endpoint, not on the server. If you wish to pass parameters into the actionscript from the server you will need to use some form of Javascript to possibly run session relevance as part of the take action process. A much more complicated scenario.

1 Like

I need to execute a command from the BIGFIX server before an update and after an update. The goal is to inform the monitoring tool that a reboot will be performed. I need to pass the hostname of the target server as argument. How can I do that operation?

Oh that is just as easy as @masonje suggested earlier

See https://developer.bigfix.com/action-script/reference/flow-control/action-parameter-query.html

You would need to target an action on the root server itself, which you can treat like any other endpoint.

I don’t think so that it will work because I need to do action on targeted servers …

Here is an example of the actions I would like to perform:

  • Execution of <local BIG FIX command> -H <target server>
  • Windows update of <target server>
  • Execution of <local BIG FIX command> -H <target server>

Any idea to help me on this topic?

Not really. I don’t think I understand the use case for running anything on the root server itself.

So it sounds like you want to signal another machine (not the BigFix root server) with a command you have, and then update that machine, then signal the machine again?

Not sure why you wouldn’t just run something local with bigfix on that server directly?

Hello,

I will try to explain a little bit more. The local command is a JMS client. The JMS client will send command into an enterprise event bus. The goal is to contact the monitoring tool to setup a maintenance period and to not generate incidents. I am not able to install this JMS client on each target server.

* Execution of <local BIG FIX command> -H <target server>
=> This command will inform the monitoring tool that we will upgrade so a maintenance period will be scheduled for this server in the monitoring tool.

* Windows update of <target server>
=> Apply windows patches & reboot on target server

* Execution of <local BIG FIX command> -H <target server>
=> This command will inform the monitoring tool that the maintenance operation is finished. The maintenance period will be canceled.

This list of tasks will be executed for about 1000 target servers.

Any idea to accomplish this goal?
Thanks.

So the mentioned here is the machine the actionscript is running on or some remote machine to the endpoint running the action?

SERVER01: server that I need to update
SERVER02: monitoring tool

* <local BIG FIX command> -H SERVER01
=> This command will inform SERVER02 that SERVER01 is in maintenance period (during the update).

* Windows update of SERVER01
=> Apply windows patches & reboot SERVER01

* <local BIG FIX command> -H SERVER01
=> This command will inform SERVER02 that SERVER01 is no longer in maintenance period (update & reboot done)

You may ve able to do something like this with the Server Automation feature (included in the BigFix Lifecycle license, maybe available separately I dunno). LifeCycle allows you to set up workflows like “Run baseline X on BES Server, then Baseline Y on targets, then Baseline Z on BES Server”.

Or you could write an application to send messages to your monitoring tool, and the REST API to create Bigfix actions to the targets.

Or change how your monitoring tool checks the clients. Like “do not alert if registry key X is set” and set/clear that reg key as part of your baseline.

1 Like