HP Insight Control for Linux 6.0 User Guide

4. Enter the command you want to run. Enter multiple commands on one line and separate
each command with a semicolon (;). The maximum length of a command is 255 characters.
5. Select Run Now to run the command immediately. Or, select Schedule to schedule the task
to occur at some point in the future
6. Select the following menu item from the HP Insight Control user interface to view the task
results:
Tasks & LogsView Task Results...
From the Task Results page, view the log for the command, which includes Stdout and
Stderr from the command.
The final state of the task is controlled by the return code from the SSH command. If the
return code from the command indicates failure, the task is in a Failed state. If the return
code from the command indicates success, the task is in a Complete state.
19.4.2 Running a Linux script
The ToolsCommand Line ToolsRun Script... menu item remotely runs a Linux script in
the Insight Control for Linux repository by opening a secure shell (SSH) connection to one or more
managed systems. This HP Insight Control for Linux tool captures Stdout and Stderr from the
script, captures the return code from the script, and closes the SSH connection.
NOTE: The Run Script... task feeds the command lines in the script to an SSH instance on the
target system. The script is a series of command lines to be run on the target system using SSH.
The Linux script you run must be located in the Insight Control for Linux repository in the /opt/
repository/script directory.
You must ensure that the Linux script does not leave any open file descriptors upon completion
(including scripts you might have called). Open file descriptors can prevent the SSH connection
from closing properly, which might cause the task to remain in a Running state indefinitely.
To run a Linux script on one or more managed systems remotely, follow these steps:
1. Select the following menu item from the HP Insight Control user interface:
ToolsCommand Line ToolsRun Script...
2. Do one of the following to select and verify that the server shown in the target list is the
server from which you want to capture its Linux image:
Select Next> if the server or servers shown in the target list are correct.
Select Add Targets... or Remove Target to modify the list if the list is incorrect.
3. Select Apply when the list is correct.
4. Select Next.
5. Select the Linux script you want to run.
6. Select Next.
7. Select Run Now to run the Linux script immediately. Or, select Schedule to schedule the
task to occur at some point in the future
8. Select the following menu item from the HP Insight Control user interface to view the task
results:
Tasks & LogsView Task Results...
From the Task Results page, you can view the log for the script, which includes Stdout and
Stderr from the script.
The final state of this task for a given target server is controlled by the return code from the
script. If the return code from the script indicates failure, the task is shown with a Failed
200 Using SSH for remote server management