|
The online home of
the company bringing you quality HP hardware and software support |
| Manipulating Systems from the HP3000 Using REMSH |
|
Integrating todays disparate computer systems is a frequent task for system administrators. Integration is not just a matter of sharing data; often it means one system controlling another. For example, a common question we field is "How can I script a job to telnet from my HP3000 to run commands on a Unix system?" The implementation of telnet on MPE does not include scripting capabilities such as redirecting input to a file, a common method of automating programs that are designed to be interactive. The answer to this is to use REMSH, which is short for Remote Shell. REMSH allows a client to execute a command on a remote server. Proper configuration of the server is key to both enabling client access and maintaining security. Once access is obtained you have a powerful method to automate procedures in a very simple way. REMSH is fairly straightforward. There are simply 3 parameters to pass. The host name or address, the UNIX login ID (designated by the l) and the command to execute specified with n. The UNIX setup (in this case HP-UX) controls security and must be set up just right. Consider the following example:
REMSH Host Setup for HP-UX. There are several ways to provide REMSH capabilities. Here I will illustrate the most secure method. The reason it is secure is because it grants access based upon the client machine and login. That is, you can deny access unless the REMSH command originated from a specific machine (the HP3000) and a specific logon (i.e. JOBS.ACCTG). All of this is controlled by placing a file named .rhosts in the home directory of the UNIX account you will log in to. In our example this is the account trucksch. Remember that under Unix a user is called an account. Each line of the file designates the machine name or IP address to accept connections from and a valid logon ID. The .rhosts file required to permit our sample job looks like this:
Note that 192.168.50.16 and hp3000.mycompany.com are interchangeable. Whenever possible it is best to use the DNS name for a machine rather than its IP address to provide for flexibility. If the IP address for a machine changes you dont want to have to go back and adjust all of the hardcoded addresses scattered around on different machines. Also note that the MPE user ID must be entered in .rhosts in upper case. Telamon (ftp://ftp.telamon.com/mpe_freeware/) also offers a version of REMSH that uses slightly different syntax and is more fully featured. The same REMSH command from our sample job looks like this running under Telamons program.
The .rhosts file on the remote HP-UX machine has an entry that looks like this:
Notice the difference in user authentication name between the .rhosts entry for MPEs built in REMSH and Telamons version. MPE built-in REMSH passes the current USER.ACCOUNT for authentication in upper case, including the dot, whereas Telamon REMSH concatenates the user and account names together and passes them in lower case. Telamon REMSH also behaves differently for users with SM capabilities by supplying "root" as the authentication user name instead of the MPE user and account. To override this option add the "-m" switch. Furthermore, Telamon REMSH includes a "-v" for verbose option, which is very handy for debugging purposes. When scripting for REMSH processing, there is a difference between logging in directly and using REMSH. You may need to setup environment variables in a script to be able to use them. When a user logs in directly to HPUX, files like /etc/profile and $HOME/.profile are executed, but they will not be executed when REMSH is used. It may be possible to get some of the environment established the same by using csh instead of sh in the /etc/passwd file for the remote user. There are details about this behavior in the man pages for remshd and sh on the UNIX computer. The csh shell uses .cshrc and .local for startup files where as sh uses /etc/profile and $HOME/.profile. There is no REMSH server for the HP3000, only a client. If you need to provide a technique for a remote server to control processes on the HP one method is the "SITE STREAM JOBNAME" in FTP. A remote user can log on to the HP and stream a job that can perform tasks on the users behalf. As you can see REMSH is a powerful tool you can utilize to automate processing. Use it to take advantage of robust job scheduling capabilities of the HP3000 (such as Maestro or Sleeper) to drive processing of other servers. Or use it to streamline frequently performed or repetetive tasks that ordinarily require you to telnet from one system to another. The possibilities are limitless. Use your imagination. |
Send mail to
webmaster@beechglen.com with
questions or comments about this web site.
Copyright © 2006
Beechglen Development Inc.
Last modified:
01/20/06