Command Assistant enables routine O&M tasks on simple application servers, such as running automated O&M scripts, polling processes, resetting user passwords, installing or uninstalling software, updating applications, and installing patches. The Cloud Assistant commands can be batch or PowerShell commands for Windows servers and shell commands for Linux servers. You can specify custom parameters as variables in commands.
Usage notes
The maximum size of a Base64-encoded command is 18 KB.
Procedure
Log on to the Simple Application Server console.
In the left-side navigation pane, click Command Assistant.
On the My Commands tab, click Create Command.
In the Create Command panel, configure parameters as instructed.
The following table describes the parameters.
Parameter
Description
Command Type
The type of the command.
Linux servers: Shell is supported.
Windows servers: Bat and PowerShell are supported.
Command Name
The name of the command.
Command
The command content.
Manually enter the command content. For example, you can enter the shell command ifconfig -s to view the brief information about the network interface controller (NIC) of the server.
Use AI Command Assistant: Press the
Ctrl+I
composite key or right-click the blank area in the Command field and then Click AI Command Assistant to invoke the AI Command Assistant. Follow the on-screen instructions to enter the command content, pressEnter
, and then click Insert Command.
You can also specify custom parameters in the
{{key}}
format such as {{parameterName}} in the Command field and enter parameter values such asls -la /etc/profile
in the Command Parameter field.You can create a maximum of 20 parameters. The parameters can contain digits and letters, and cannot be empty strings. Each parameter can be up to 64 characters in length.
For more information, see Common commands.
Used Parameters
Specifies whether to use parameters.
If you specify custom parameters in the
{{key}}
format in the Command field and turn on Use Parameters, you must enter values of the parameters in the Command Parameters field.NoteYou can create up to 20 parameters. The parameters can contain digits and letters, and cannot be empty strings. Each parameter can be up to 64 characters in length.
Command Description
The description of the command.
We recommend that you enter information such as the purpose of the command to facilitate subsequent management and maintenance.
Execution Path
The working path of the command. You can specify a value for the parameter. Default working paths vary based on the operating systems of the servers on which the command is run.
For Linux servers, the default working path is the
/root
directory of the root user.For Windows servers, the default working path is
C:\Windows\system32
.
Timeout Period
The timeout period of the command. If a task that runs the command times out, Command Assistant forcefully stops the task process.
Unit: seconds. The default timeout period is 60 seconds. You can set the timeout period to a value from 10 to 86400 seconds (24 hours).
Click Create Command.
Related operations
After you create a command, you can view the command, clone the command, and delete the command.
Operation | Description | Procedure |
View a command | After you create a command, you can view the details of the command. |
|
Clone a command | You can quickly create new commands by modifying the parameter settings of existing commands. |
|
Delete a command | If you no longer require a command, you can manually delete the command. |
|
Common commands
In this topic, Linux shell commands are used to describe common O&M commands, as shown in the following table.
Custom parameters in a command make the command applicable to more scenarios. In the following sample commands, the parameters in the {{key}} format are custom parameters. When you run the commands, turn on Use Parameters and enter the values of the custom parameters in the Command Parameters field.
Operation | Sample command |
Change the logon password of a server. | Run one of the following commands based on the operating system of your server:
Note
|
Add, remove, or modify user information |
|
Enable or disable a firewall, and view the status of a firewall |
|
Install software Note In this example, NGINX is installed on the CentOS 7 operating system. |
|
Install CloudMonitor Note For more information, see Install and uninstall the CloudMonitor agent for C++. |
Important Replace |
View the system configurations of a server |
|
What to do next
After you create a command, you can run the command on a specified server on the My Commands tab. For more information, see Run commands.