beautypg.com

HP Insight Control Software for Linux User Manual

Page 145

background image

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 managed systems, you must first define SSH credentials (that is, login and
password) for the target systems into HP SIM with Options

→Security→Credentials→System

Credentials.....

To run a Linux script on one or more managed systems remotely, follow these steps:
1.

Select the following menu item from the Insight Control user interface:

Tools

→Command Line Tools→Run Script...

2.

Do one of the following to select and verify that the managed system in the target list:

Select Next> if the target list is 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 in the future

8.

Select the following menu item from the Insight Control user interface to view the task results:

Tasks & Logs

→View Task Results...

From the Task Results page, you can view the log for the script, which includes Stdout and
Stderr from the script.

The return code from the script controls the final state of this task for a given target system. If
the return code from the script indicates failure, the task is shown with a Failed state. If the
return code from the script indicates success, the task is in a Complete state.

16.4 Using Insight Control for Linux to run commands and scripts through SSH

145