You can access the N1 System Manager using the n1sh command. The default method is to use the n1sh shell, which uses an N1–ok> prompt. The shell mode provides a tab completion feature to navigate through all the command options. See the n1sh man page for details. Type man n1sh from a console in the management server. You don't need to be in the n1sh shell to read the n1sh man page.
The n1sh command provides two other ways to issue management commands. The n1sh -e option, or UNIX® command mode, enables you to type management commands one at a time within a UNIX shell. The n1sh -f option enables you to specify a custom script of management commands to run. See the n1sh man page for details. Type man n1sh from a console in the management server. You don't need to be in the n1sh shell to read the n1sh man page.
For information about command line syntax, keywords, special characters, and general syntax, see Command Line Interface Tips in Sun N1 System Manager 1.3 Command Line Reference Manual.
The following procedure describes how to access the N1 System Manager command line (the n1sh shell) as a valid user from a remote system. You can also access the command line directly on the management server.
During management server configuration, the superuser (root) account is set up with all the system default roles added to it (Admin, ReadOnly, and SecurityAdmin). If you want to log in as a valid user other than the superuser account, see To Add an N1 System Manager User.
Log in to the management server from a remote system.
$ ssh -l user-name management-server |
Where user-name is a valid N1 System Manager user, and management-server is the host name or IP address of the management server.
You are prompted for a password.
Type a password for the user account.
The N1–ok> prompt is displayed and you are logged in with your default N1 System Manager role, unless you use the -r option to specify a role for login.
If the N1–ok> prompt does not display, type the following command to access the command line:
# /opt/sun/n1gc/bin/n1sh [-r role-name] |
The superuser (root) user account typically does not have its login configured to automatically log in to the n1sh shell.
(Optional) To switch to a different N1 System Manager role that has been added to your user account, type the following command:
N1-ok> set session role role |
See set session in Sun N1 System Manager 1.3 Command Line Reference Manual for details.
Your role might affect your ability to access certain features of the N1 System Manager. By default, you are logged into the N1 System Manager with your default role.
See Managing Roles for more details about roles.
Log in to the N1 System Manager.
See To Access the N1 System Manager Command Line for details.
Show your current session role.
N1-ok> show session |
If you have more than one role, you can switch between multiple roles to perform tasks that require specific privileges.
See Managing Roles for more details about roles and privileges.
Log in to the N1 System Manager.
See To Access the N1 System Manager Command Line for details.
Switch to a different session role.
N1-ok> set session role role |
See set session in Sun N1 System Manager 1.3 Command Line Reference Manual for details.
Exit the N1 System Manager command line.
N1-ok> exit |
The n1sh shell is terminated.
The following procedure describes how to run a custom script of N1 System Manager commands that are saved in a file. Return codes are returned for each command. Also, you can specify a comment character (#) at the beginning of the line to indicate that the rest of the line should be ignored.
Log in to the N1 System Manager.
See To Access the N1 System Manager Command Line for details.
If the n1sh shell is your default login shell on the management server, you must change this configuration. Otherwise, you won't be able to run the n1sh command and use the script option.
Run a custom script that contains the N1 System Manager commands.
# /opt/sun/n1gc/bin/n1sh -f filename |
where filename is a fully qualified path to the custom script file.
The following example shows an n1sh script file, which can be run with the n1sh -f command.
# n1sh custom script show group all create group RACK1 create group RACK2 create group RACK3 create group RACK4 create group RACK5 add group RACK1 server SERVER1 add group RACK1 server SERVER2 add group RACK2 server SERVER3 add group RACK2 server SERVER4 add group RACK3 server SERVER5 add group RACK3 server SERVER6 add group RACK4 server SERVER7 add group RACK4 server SERVER8 add group RACK4 server SERVER9 add group RACK4 server SERVER10 add group RACK5 server SERVER11 add group RACK5 server SERVER12 show group all