TSM Installer

(imported topic written by SystemAdmin)

I’m trying to create a TSM backup client in *nix and after installing the software and configuring the dsm.sys and dsm.opt files, one needs to run “dsmc q sess” to seed the nodenam/password authentication. TSM requires interactive prompting for this process and cannot use redirection to pass the password either. Is there any tricks I can do to make bigfix answer prompts within a fixlet?

Here is a sample of the prompting:

Node Name: CBCLNXADMIN

Please enter your user id : enter

Please enter password for user id “CBCLNXADMIN”: adsm

If you attempt to use redirection, we get the following error:

ANS2050E TSM needs to prompt for the password but cannot prompt because the process is running in the background.

(imported comment written by JackCoates91)

Try using runascurrentuser.exe to handle your prompt passing; I’m guessing that the UI jumps to the user’s session but we’re still running in local system’s session.

If that doesn’t work, you could probably wrap the whole thing in AutoIT.

(imported comment written by SystemAdmin)

What is runascurrentuser.exe? and autoit?

All my clients are AIX, Solaris or Linux, NOT Windows

(imported comment written by JackCoates91)

Sorry, missed that

*nix

in your message. Same basic principle applies… your program is no longer looking for input in the natural place, but is rather seeking input from somewhere else, so the pipe no longer works. Runascurrentuser is no longer applicable because the potential sessions redirections are too complex in *nix, but the suggestion to wrap the project in another scripting language could still be applicable. However, since you don’t have AutoIt on *nix you’ll want to use your favorite shell (such as bash) or higher-level language (such as Perl).

(imported comment written by SystemAdmin)

Resolution: expect

Using expect, created a script to handle the prompting

#!/usr/bin/expect -f

  1. Script to setup TSM authentication for the first time

  1. Set Variables

set password adsm

  1. Now connect to TSM with supplied Nodename and enter password
  2. The nodename in this case is the hostname, so just accepting the value by passing \r

spawn dsmc q sess

  1. Look for Nodename prompt

expect “Please enter your user id”

send – “\r”

  1. Look for password prompt

expect “Please enter password for user id”

send – “$password\r”

send – “\r”

expect eof

(imported comment written by JackCoates91)

just like a modem chat script :slight_smile: