Guidelines for Writing SM Command Scripts

Below are some basic guidelines for the management of your systems via written scripts for remote execution on one or more Service Processors.

Shell Scripts
You should be familiar with standard shell scripting. To create your scripts, use the examples provided in the NSV under the commands/sample_scripts/scripts directory as a starting point.

 

SSH
You must currently use an SSH (Secure Shell) client to execute automated SM command scripts.

 

Authentication
To avoid a password prompt each time you run a script on a Service Processor, upload a public key or trusted host key to each Service Processor.

 

Authorization Levels
User groups define standard privileges. Access changes (such as adding users or uploading keys) typically requires manager-level access while most other management tasks can be performed by an administrator-level user.

 

Return Codes
Every subcommand returns one or more return codes when it completes.

 

Nowait Argument
Most commands complete quickly and are performed synchronously. For some longer operations (such as rebooting the platform) a --nowait option is provided so that a script can initiate the operation without waiting for it to return.

 

Quiet Argument
The delete and update operations (such as access delete user, sp delete event) accept multiple targets. To ensure that a certain set of targets is deleted on a set of Service Processors, you can use the --quiet argument to suppress errors if one of the targets is not found or to suppress interactive warning messages from the platform command.

 

Command Output
Common, general output is detailed below:

Common characteristics of table output are detailed below:

Other Tips

Related Topics

Configuring Shell Scripts

Configuring the Client for Scripting

Configuring Multiple Systems for Scripting

Return Codes