All Products
Search
Document Center

Simple Application Server:Create a command

Last Updated:Jun 17, 2026

Command Assistant runs routine O&M tasks on Simple Application Server instances, such as automated scripts, process polling, password resets, software installation, and patch updates. Supported command types include Windows PowerShell scripts, Bat batch commands, and Linux Shell scripts, with custom parameters for flexible variable values.

Limitations

The size of a Base64-encoded script cannot exceed 18 KB.

Procedure

  1. Go to the Command Assistant page in the Simple Application Server console.

  2. On the My Commands tab, click Create Command.

  3. In the Create Command panel, configure the parameters.

    The following table describes the available parameters.

    Parameter

    Description

    Command Type

    Select a command type.

    • Linux servers support the Shell command type.

    • Windows servers support the Bat and PowerShell command types.

    Command Name

    Enter a name for the command.

    Command

    You can enter a command in one of the following ways:

    • Manual input: Enter a command, such as the Shell command ifconfig -s, to view brief information about the server's network interface cards.

    • Using AI Command Assistant: Press Ctrl+I or right-click to open the AI Command Assistant. Enter a description of the task, press Enter, and then click Insert Command.

      For example, if you enter "how to check the current system time", the AI Command Assistant returns the corresponding shell command date and a description of its function.

    You can also use the {{key}} format in the command content to create a custom parameter, such as {{parameterName}}, and enter its value, such as ls -la /etc/profile, in the Command Parameters field.

    You can create up to 20 parameters. Parameter names must contain only letters and digits, cannot be empty, and can be up to 64 characters long.

    For more command examples, see Common commands.

    Used Parameters

    Specify whether to enable parameters.

    When you enable Used Parameters, you can define custom parameters in the Command field by using the {{key}} format and provide their values in the Command Parameters section.

    Note

    Parameters can contain only letters and digits, must not be empty, and must be 64 characters or less.

    Command description

    Enter a description for the command.

    A clear description helps with command management and maintenance.

    Execution Path

    Specify a custom execution path for the command. The default paths are as follows:

    • Linux instances: the default execution path is the /root directory of the root user.

    • Windows instances: the default execution path is the C:\Windows\system32 directory.

    Timeout Period

    Set the timeout period for command execution on an instance. If a task exceeds this limit, Command Assistant forcibly stops it.

    The value is in seconds. The default value is 60. The valid range is 10 to 86,400 (24 hours).

  4. Click Create Command.

Related operations

After you create a command, you can view, clone, or delete it.

Actions

Description

Procedure

View a command

View the details of an existing command.

  1. In the Actions column of the target command, click View.

  2. In the Command panel that appears, view the command details.

Clone a command

Create a new command by modifying an existing one.

  1. In the Actions column of the target command, click Clone.

  2. In the Clone Command panel that appears, modify the parameters and click Clone Command.

Delete a command

Delete a command you no longer need.

  1. In the Actions column of the target command, choose Delete.

  2. In the Delete Command dialog box that appears, click OK.

Common commands

The following table lists examples of common O&M tasks that use Shell commands in Linux.

Note

Custom parameters in commands increase their reusability. In the following examples, parameters in the {{key}} format are custom parameters. To run these commands, enable Used Parameters and enter the parameter values in the Command Parameters section.

Task

Example command

Change the instance system password

To change the logon password, run the appropriate command for your operating system.

  • Linux:

    echo "root:<yourPassword>"|chpasswd
  • Windows:

    net user "Administrator" "<yourPassword>"
Note
  • Replace <yourPassword> with the new password.

  • The password must be 8 to 30 characters long and contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters. For a Windows instance, the password cannot start with a forward slash (/).

Add, delete, or modify user information

  • Add a user and set a password

    useradd -m {{newUser}} && echo "{{newUser}}:{{password}}" | chpasswd
  • Change a password

    passwd {{password}}
  • Delete a user

    userdel {{newUser}}
  • Change a username

    usermod -l {{newUser}} -d /home/{{newUser}} -m {{previousUser}}

Enable, disable, and check the status of the firewall

  • Enable the firewall

    systemctl start firewalld
  • Disable the firewall

    systemctl stop firewalld
  • Check the firewall status

    systemctl status firewalld

Install software

Note

This example shows how to install Nginx on a CentOS 7 operating system.

yum -y install nginx

Install the CloudMonitor agent

Note

For more information, see Install and uninstall the CloudMonitor agent.

ARGUS_VERSION=3.5.7 /bin/bash -c "$(curl -s https://cms-agent-cn-hongkong.oss-cn-hongkong-internal.aliyuncs.com/Argus/agent_install_ecs-1.7.sh)"
Important

Replace cn-hongkong in the command with the region ID of your Simple Application Server instance. For information about how to obtain a region ID, see Regions and zones.

View instance system configuration

  • View the basic configuration of the instance

    # Display information about active NICs.
    ifconfig
    # Display information about all NICs.
    ifconfig -a
    # Display brief information about NICs.
    ifconfig -s
    # View memory information.
    free -g
    # View memory information.
    cat /proc/meminfo
    # View operating system information, such as the kernel version.
    uname -a
    # View disk usage.
    df -h
    # View all hardware information.
    dmidecode | more
  • View system process or file information

    # View information about all processes.
    ps -ef
    # View information about a specific process. {{processName}} is a custom parameter that requires a value at runtime.
    ps -ef | grep {{processName}}
    # View the details of a file in a path.
    ls -la {{fileName}}
    # Find a file path.
    find {{path}} | grep {{fileName}}

Next steps

After you create a command, you can run the command on specific instances from the My Commands tab. For more information, see Run a command.