Execute Remote Command

A common requirement is for automation to connect to a remote host i.e. windows or linux and to then preform a set of actions such as executing commands.

In this guide we will create a data trigger to define a list of hosts, then connect to each host and execute a command to view the filesystem disk usage. This can easily be expanded to make sure of other integrations such as asset to enable the automation to be more dynamic.

Requirements

  • Remote integration

Steps

  1. Add Data Trigger object to the flow
  2. Edit the trigger, name it and define its event list ( we will use a very simple event structure that just defines the host we want to connect to )
[
  {
    "host": "host1.local"
  },
  {
    "host": "host2.local"
  }
]
  1. Add Remote Connect Linux
  2. Edit the action, name it, set the host to our event value %%data[event][host]%% and then configure either username / password or username / key pair
  3. Add Remote Command
  4. Edit the action, name it and define the command you want to run in this example we will use df -h to get the filesystem usage

Preview