1 running an ssh command – HP Insight Control Software for Linux User Manual
Page 199
•
The -w option enables you to specify a range of managed systems or a specific managed
system.
Description
Command line
Runs the hostname command on the first five managed systems
in the collection.
IMPORTANT:
You must use the Insight Control for Linux internal
name (which is based on the Insight Control for Linux collection
name) when you specify a range of managed systems. In the
example, icelx is the Insight Control for Linux internal name.
# pdsh -w icelx[1-5] hostname
earth: earth.example.com
eris: eris.example.com
mercury: mercury.example.com
mars: mars.example.com
pluto: pluto.example.com
Runs the uptime command on a specific managed system. In the
example, mercury is the real host name
# pdsh -w mercury uptime
For more information, see pdsh(1) and the following website:
19.4 Using HP Insight Control for Linux to run commands and scripts
through SSH
The following menu items enable you to run a script or command through SSH to one or more
managed systems:
•
Tools
→Command Line Tools→Run SSH Command...
•
Tools
→Command Line Tools→Run Script...
19.4.1 Running an SSH command
The Tools
→Command Line Tools→Run SSH Command... runs a command on a target server.
This tool operates on the target server by opening a secure shell (SSH) connection to the target
server, running the command, capturing Stdout and Stderr from the command, capturing the
return code from the command, and closing the SSH connection.
You must define SSH credentials into HP SIM for the target server in order to use this menu
item.
Select the following menu item from the HP Insight Control user interface to update the SSH
Settings
for one or more target managed systems:
Options
→Protocol Settings→System Protocol Settings
IMPORTANT:
Any HP SIM user that has access to this tool is able to run any command on the
target managed system with the privileges of the user you entered into the System Protocol
Settings
page. If you entered the root user and password into the System Protocol Settings,
any HP SIM user with access to this tool also has root privileges on the target managed system.
To run an SSH command on one or more managed systems, follow this procedure:
1.
Before you begin, ensure that the command you intend to run does not leave any open file
descriptors upon completion (including called scripts).
Open file descriptors might prevent the SSH connection from closing properly and might
cause the task to remain in a Running state indefinitely.
2.
Select the following menu item from the HP Insight Control user interface:
Tools
→Command Line Tools→Run SSH Command...
3.
Select one or more target managed systems.
19.4 Using HP Insight Control for Linux to run commands and scripts through SSH
199