How NSH connects with targets
Depending on how NSH is launched and from where it is launched, you might receive different results when using NSH to connect to an RSCD agent. This topic discusses several common methods for launching NSH and analyzes how the different connection methods work.
Method 1: Launching NSH through the TrueSight Server Automation Console
To launch NSH through the TrueSight Server Automation Console on your workstation, right-click the relevant server objects, and select the NSH Here custom command.
The following table analyzes the setup requirements and connection specifications of this method:
Details | NSH proxy enabled | Without NSH proxy |
---|---|---|
Setup requirements |
|
|
What credentials are used? | The credentials stored in the %APPDATA%\BladeLogic\bl_sesscc or $HOME/.bladelogic/bl_sesscc file. These credentials were stored in the session credential cache during logon. | The credentials used to start the Console are set as environment variables in the created session — NSH_ROLE_NAME, NSH_USER_NAME, and BL_RBAC_ROLE. These environment variables are used to establish the TrueSight Server Automation credentials. |
How is the connection made? | NSH on the client makes a connection to the NSH Proxy URL stored in the BLSSO token, and the NSH proxy (an application server) makes a connection to the RSCD agent. | The NSH client establishes a connection directly with the target server. |
Where is the activity logged? |
|
|
What if a SOCKS proxy is used for the target server? | The NSH client will connect to the NSH proxy and the NSH proxy (application server) will resolve the network routing rules that may apply to the target. | NSH Here will allow the network routing rule to be resolved. The connection will then come from the SOCKS proxy and not the local client. |
Possible errors |
| If the workstation cannot communicate with the target server on TCP port 4750, the NSH Here window will open and close quickly. This could be due to network access issues or because the exports file on the target prevents access from the workstation. |
Method 2: Launching NSH through a command line on the Application Server host
Through a command line on the Application Server host, you execute NSH and change directory (cd) to a target server.
The following table analyzes the setup requirements and connection specifications of this method:
Details | NSH proxy enabled | Without NSH proxy |
---|---|---|
Setup requirements |
|
|
What credentials are used? | The credentials stored in the %APPDATA%\BladeLogic\bl_sesscc or $HOME/.bladelogic/bl_sesscc file. These credentials were stored in the session credential cache during logon. | NSH without the NSH proxy cannot use the BLSSO token. Therefore, the OS user name that was used to start NSH is sent over to the target. Unless there is a mapping entry for the OS user name on the target, you will receive the error messsage "No authorization to access host." This error is expected because the mappings should be for Server Automation role:user names. However, this does indicate that the NSH client is able to connect to the RSCD agent. |
How is the connection made? | NSH on the client makes a connection to the NSH Proxy URL stored in the BLSSO token, and the NSH proxy (an application server) makes a connection to the RSCD agent. The name passed to the nsh command must match the server object name registered in TrueSight Server Automation. For example, if you have server1.example.com registered in TrueSight Server Automation, you must use the following NSH command for the NSH proxy to connect to the target: | The NSH client establishes a connection directly with the target server. |
Where is the activity logged? |
| In the rscd.log on the target server, you will see a message such as the following: 464e5c2a971b36154744 0000000007 01/24/17 15:38:58.202 INFO rscd - ::ffff:192.168.52.203 4273 0/0 (root): agentinfo: agentinfo blapp.local This message shows that the connection is established as root, because the NSH client was started as root and was mapped to root (0/0) by the RSCD agent based on the exports setting. |
What if a SOCKS proxy is used for the target server? | The NSH client will connect to the NSH proxy and the NSH proxy (application server) will resolve the network routing rules that may apply to the target. | Without the connection through the Application Server to resolve the network routing rule, the NSH client will be unable to communicate with the target. |
Possible errors |
| The Application Server should be able to connect to the target. However, since there are no TrueSight Server Automation credentials available, the connection will be denied without a mapping entry. This is typically the desired situation. |
Method 3: Launching NSH through a command line on the workstation
Through a command line on the workstation where the TrueSight Server Automation Console is installed, you execute NSH and change directory (cd) to a target server.
The following table analyzes the setup requirements and connection specifications of this method:
Details | NSH proxy enabled | Without NSH proxy |
---|---|---|
Setup requirements |
|
|
What credentials are used? | The credentials stored in the %APPDATA%\BladeLogic\bl_sesscc or $HOME/.bladelogic/bl_sesscc file. These credentials were stored in the session credential cache during logon. | NSH without the NSH proxy cannot use the BLSSO token. Therefore, the OS user name that was used to start NSH is sent over to the target. Unless there is a mapping entry for the OS user name on the target, you will receive the error messsage "No authorization to access host." This error is expected because the mappings should be for Server Automation role:user names. However, this does indicate that the NSH client is able to connect to the RSCD agent. |
How is the connection made? | NSH on the client makes a connection to the NSH Proxy URL stored in the BLSSO token, and the NSH proxy (an application server) makes a connection to the RSCD agent. The name passed to the nsh command must match the server object name registered in TrueSight Server Automation. For example, if you have server1.example.com registered in TrueSight Server Automation, you must use the following NSH command for the NSH proxy to connect to the target: | The NSH client establishes a connection directly with the target server. |
Where is the activity logged? |
| In the rscd.log on the target server, you will see a message such as the following: 464e5c2a971b36154744 0000000007 01/24/17 15:38:58.202 INFO rscd - ::ffff:192.168.52.203 4273 0/0 (root): agentinfo: agentinfo blapp.local This message shows that the connection is established as root, because the NSH client was started as root and was mapped to root (0/0) by the RSCD agent based on the exports setting. The incoming IP is that of the NSH client (the workstation IP) and the user name sent is whatever name was used to log on to the workstation. |
What if a SOCKS proxy is used for the target server? | The NSH client will connect to the NSH proxy and the NSH proxy (application server) will resolve the network routing rules that may apply to the target. | Without the connection through the Application Server to resolve the network routing rule, the NSH client will be unable to communicate with the target. |
Possible errors |
|
|
Method 4: Submitting an NSH script
You submit an NSH Script Job to perform actions against the same target server.
The following table analyzes the setup requirements and connection specifications of this method:
Details | NSH proxy enabled | Without NSH proxy |
---|---|---|
Setup requirements | The secure file on the Application Server must contain the appserver_protocol=ssoproxy entry in the default line. | The secure file on the Application Server does NOT contain the appserver_protocol=ssoproxy entry. |
What credentials are used? | The CLI_SSO_CREDS environment variable is set with the RBAC role:user that runs the job. The credentials from the environment variable override anything set in the secure file. | The application server provides the credentials of the role:user running the job. |
How is the connection made? | The BLSSO token generated by the Application Server uses the value of the ProxyServiceURLs setting from the Application Server instance that runs the WorkItemThread for the job for the particular target to determine what NSH proxy to connect to. If the setting is blank and the instance has a ProxySvcPort set, it will generate a ProxyServiceURL that points to itself. | The Application Server that runs the job makes a direct connection to the target server. |
Where is the activity logged? |
| In the rscd.log on the target, a message shows that the connection comes from the Application Server and indicates the role and user name that ran the job.
|
What if a SOCKS proxy is used for the target server? | The NSH client will connect to the NSH proxy and the NSH proxy (application server) will resolve the network routing rules that may apply to the target. | The Application Server will set a BLSSOPROXY environment variable that will indicate what proxy should be used to communicate with the target. |
Possible errors |
| Typically, the only issues encountered here are with network connectivity to the target. |
Additional notes
- You do not need to use an NSH proxy for jobs when using SOCKS. The only reason to do so is if you you are running a script and it needs to copy files between servers in different proxy zones. For example, an extended object needs to be copied from the file server or along the following path of servers: SOCKS 1 > Server 1 > SOCKS 2 > Server 2. For the case of a file server, if the SOCKS proxy can talk to the file server on port 4750, you should not need an NSH proxy.
- You can enable the proxy (or any other setting) for specific servers in the secure file. Instead of default, specify hostname:port=xxx:etc.
- The appserver_protocol is only set on the default line (or host override line), not on the rscd line
- If you want to use an Automation Principal for RSCD access (and not use an Agent Installer Job), NSH must use an NSH proxy.
- The server name that you provide to NSH must match what is registered in TrueSight Server Automation, to ensure that the NSH proxy can be used to talk to the target.
- There is no reason to have a default line on an RSCD agent. Therefore, the NSH proxy configuration is done on the NSH client and not on the RSCD agent.