Use remote script execution

Remote script execution allows you to run scripts on your registered client instances directly from the Landscape web portal. Scripts can be in any language, as long as an appropriate interpreter is available on the clients where they will run.

This document guides you how to use remote script execution for client instances on classic Ubuntu systems. If you’re using the Landscape Client snap on Ubuntu Core, see How to use remote script execution with the Landscape Client snap.

Prerequisites

Before you can execute scripts from Landscape Server, you must have remote script execution enabled on the target client instances.

Add a new script

To add a new script:

  1. Go to Scripts from the sidebar > Add script

  2. Copy your script into the editor or populate it from a file

  3. Complete the other portions of a form, including a title for the script, access group, and optional attachments, then Add script

You can edit, archive, run and more on the script using the dot menu under Actions for each script.

Archive or redact scripts

You can archive or redact scripts that you no longer want to use. Both actions are irreversible, and in both cases the script’s name can’t be reused for a new script.

  • Archive prevents the script from running in the future. The script’s record and contents are kept, and an archived script can still be redacted later.

  • Redact permanently removes the script’s contents and attachments from Landscape. A record of the script, including who redacted it and when, is retained.

If the script is used by script profiles, archiving or redacting it also archives those profiles, and their names can’t be reused either.

To archive or redact a script, go to Scripts > open the dot menu under Actions for the script > Archive or Redact. Review the confirmation dialog and follow the instructions to confirm the action.

You can view archived and redacted scripts using the Status filter.

Run a script on one or more instances

To run a script on one or more instances:

  1. Go to Instances from the sidebar > Select the target instance(s) > Operations > Run script

  2. In the side panel that opens, complete the form > Run

    • Note: Time limit is the maximum time the script can run before Landscape forcibly terminates it

View script execution status and results

After you run a script, you can monitor its progress and view results.

From the Activities page

The Activities page shows the activity status for all instances and all activities. Your script execution activities will appear here.

From an instance’s detail page

  1. Go to Instances > Select your instance > Activities tab to view all activities for that instance, including script executions.

  2. Click on a script execution activity to view details, such as status, when the script was run, and output/results from the script (if any).

Schedule scripts with script profiles

To run scripts on a recurring schedule or at specific times, use script profiles. Script profiles allow you to run scripts based on certain triggers.

For details, see how to use script profiles.