Close this search box.

How to configure the Scheduler for script execution on OCI

In this tutorial we explain the steps necessary to use script execution via scheduler in Cloud8 for the Oracle cloud (OCI).

Attention ! Check if you have the necessary permissions in the cloud and do a test before making your first appointment! Check out the detailed documentation.

Configuring permissions in OCI #

1. Make sure that in the instances that will run the command, the OCI agent is enabled and the “Compute Instance Run Command” plugin is also enabled;

2. Configure the following under Policy :

Allow group __group__ to manage instance-agent-command-family in tenancy
Allow dynamic-group __dynamicgroup__ to use instance-agent-command-execution-family in tenancy

3. Important: it is necessary to create a Dynamic Group for the instance(s):

4. When creating a new one, in “ rule “, put something with the compartments that need permission:

All { = 'ocid1......'}

Testing the configuration #

  1. Access the OCI Instances section –
  2. Select the configured instance
  3. Click on “ Run command ” and then “ Create command ”
  4. For the Linux environment, in “ Add Script “, put a simple shell command like “ /sbin/ifconfig “
  5. Wait until the Delivery Status and Execution Status change to “ Acknowledged ” and “ Succeeded ”
    • If the status changes to “ Expired ” or takes a long time without a response, there is probably not enough permission for this action

Configuring scheduling in Cloud8 #

1. In the Cloud8 Dashboard interface, open the action schedule and select the server(s) where you will run the script(s):

2. Select Script – Command in Type, write “ ShellScript ” in Data – for the execution type (valid for Linux and Windows) and click on “ Params “:

3. Type a simple command like “ /sbin/ifconfig “, click “ Update ” and then the left-to-right arrow to include it in the workflow.

4. Complete the scheduling data and you are ready to run .

You can include as many ‘ Commands ‘ as you need, and parameterize for asynchronous execution, in addition to logging the script’s output in the audit.