Create Script Execution Tasks

Through task management, you can create script execution tasks.

About this task

With the script execution function, you can execute certain operations in batch, including changing the configuration of the host (such as the host name and IP address). You can manually import scripts, upload scripts from your computer or public platform, or clone existing scripts, and execute them in batch.

After the task is created, you can manage the script execution tasks. For example, you can apply them to the scheduled tasks and workflow, or you can perform the tasks for many times.

Procedure

  1. Log in to the Operation System Platform Console.
  2. In the left navigation pane, click Job Management > Task Management.
  3. On the Task Management page, click Create in the upper-right corner.
  4. On the Add task page, select Script execution as the Task Type.
  5. After that, you need to complete the following configuration.
    Configuration Item Description

    Task Name

    About the script execution task name.

    Task Description

    About the script execution task description.

    Script type

    Select the script type according to the host type:

    • If the host is of Linux system, select Shell as the script type.
    • If the host is of Windows system, select PowerShell as the script type.

    Target host

    Select the hosts on which the scripts will be executed. (The corresponding OS type of Hosts will be filtered with selected scripts. Linux hosts can be chosen with Shell script, and Windows hosts can be chosen with PowerShell script). Currently, there are two methods for selecting hosts:
    • Method One: Select Host

      Click +Select host. On the Select host page that opens, tick one or more hosts, and then click Select.

    • Method Two: Import Host

      Click Fast Import. In the Host List field, enter host names or IP addresses, and then click Host match. If the matches succeed, click Confirm.

      Note: Type in IP or Host Name, separated by comma(,), semicolon(;), vertical bar(|), or line break( ).

    Script source

    Four methods are supported currently:

    • Manual Input: Write a script in the script creator.
    • Local Upload: According to the script type, select a script file from your computer and add the script content to the creator.
      Note: The maximum size of the script file is 30K.
    • Script Clone: Select one of your scripts and add the content to the creator.
    • Public Script: Select one of the scripts provided by public platform and add the content to the creator.

    Script content

    The specific content of the script executed on the host.

    Note: The content cannot exceed 30000 characters.

    Script parameter

    Click Execute now, and then the script content will be saved as a file in the system and is executed via Powershell, CMD or Bash based on the operating system. The script parameters will be appended to the actually executed command.

    For example, suppose the script is named as abc.ps1 and is executed via Powershell, and the script parameters are key1=value1,key2=value2, then the command finally executed in the target server is powershell -File abc.ps1 key1=value1 key2=value2.

    Overtime

    Set up the overtime of task execution. If the process exceeds the set time, CloudAgent will end the progress. Use minute as the unit and the time range is between one minute to 30 minutes. If the setup is left blank, the overtime by default will be 30 minutes.

  6. After that, click Confirm Create.
Did the above content solve your problem? Yes No
Please complete information!

Call us

400-151-8800

Email us

cloud@pingan.com

Online customer service

Instant reply

Technical Support

cloud products