This section contains a few tips to help you use the N1 System Manager CLI.
The general syntax for an N1 System Manager command is:
command object [object-value] [object [object-value]]* [attribute[=][attribute-value]]* |
command – The action taken on the object.
object – A system-defined object that is fundamental to the operation being performed. The target of the operation is usually the first object in the command's syntax.
object-value – A value for the object, which is usually user-defined. Values containing spaces must be enclosed within quotation marks.
attribute – A system–defined and optional object that affects the way the operation is performed.
attribute–value – A user-defined value for the attribute. Values containing spaces must be enclosed within quotation marks.
For simplification purposes, the attribute term is usually used to describe both objects and keywords.
User-defined names, such as OS profile or group names, may include numbers, letters, and some special symbols. The following special symbols are prohibited: comma, asterisk, single quotes, double quotes, parenthesis, question mark, equal sign, and newline.
The id keyword is an optional keyword that can be used on the N1 System Manager CLI before some attribute values, typically for the server attribute value. The purpose of this keyword is to allow the use of an attribute value that is the same name as a reserved keyword (for example, a server named upgrade).
The equal sign (=) can be used between attribute names and attribute values on the N1 System Manager CLI. For example, the following commands are equivalent:
N1-ok> set role MyRole description myDescription N1-ok> set role MyRole description=myDescription |
The equal sign variant is not shown in the CLI help.
When creating a customized n1sh script, you can specify the comment character (#) at the beginning of the line to indicate that the rest of the line should be ignored. See To Run a Script of N1 System Manager Commands in Sun N1 System Manager 1.3 Discovery and Administration Guide for more information.
Where allowed, multiple attribute values can be specified as a comma–separated list on the N1 System Manager command line. For example:
N1-ok> set server serverA,serverB,serverC locator on |
In the CLI help, multiple attribute values are shown using the following syntax notation: set server <server>[,<server>...]
Spaces are not allowed between commas.
Single and double quotation marks are supported in the n1sh shell mode. If needed, either type of quotation mark can be escaped using the backslash character. For example:
N1-ok> set role myRole description "Some Role that I've made up" N1-ok> set role myRole description='Some Role that I\'ve made up' |
Depending on the shell you are using to run n1sh in UNIX command mode, some special characters may need to be escaped. For example, in the bash shell, quotation marks need to be escaped with the backslash character, like this:
$ n1sh set role MyRole description=\"Some Role that \\\"Paul\\\" made up\" |
Or, you can use single quotation marks to escape double quotation marks:
$ n1sh set role MyRole description='"Some Role that \\"Paul\\" made up"' |
See your specific shell's documentation for more information about escaping special characters.
In the n1sh shell mode, you do not have to escape special characters, so the same command described above would appear as follows:
N1-ok> set role MyRole description="Some Role that \"Paul\" made up" |
You can type a question mark (?) for any password attribute value if you do not want the password to display in the command line. Once you issue the command, you are prompted for the password. Examples include the rootpassword and agentssh attributes.