ADSM-L

activity log turning on help in TSM (Tivoli storage manager) 5.1?

2002-11-05 16:44:15
Subject: activity log turning on help in TSM (Tivoli storage manager) 5.1?
From: murali ramaswamy <muralirama29 AT HOTMAIL DOT COM>
To: ADSM-L AT VM.MARIST DOT EDU
Date: Tue, 5 Nov 2002 21:43:37 +0000
Hi,
Any ideas how to turn activity log on so that activity log file generated in
Tivoli Storage Manager.  When I set the location for the activity log
through client GUI, the log file not generated after backup.
Thanks
-murali






From: Andrew Raibeck <storman AT US.IBM DOT COM>
Reply-To: "ADSM: Dist Stor Manager" <ADSM-L AT VM.MARIST DOT EDU>
To: ADSM-L AT VM.MARIST DOT EDU
Subject: Re: HELP ON wzrdhlpr.exe command lIn TSM (Tivoli storage manager)
5.1?
Date: Sun, 3 Nov 2002 01:01:03 -0700

1) My primary advice is that you follow the advice I gave you before, and
work on getting the ODBC driver set up correctly. I pointed you to
detailed diagnostic information in the README file, and offered to have
you send me the results so that I can get a better understanding of the
problem. Once the ODBC driver is set up correctly, it will work as I have
already shown you.

2) While it may work okay, I do not recommend using the wzrdhlpr.exe file
that ships with the TSM server, as it is not intended for end-user use.
Instead, you should be using the administrative command line interface
that ships with the TSM client, dsmadmc.exe.

3) To read the file "murali", get rid of the imports for
java.io.InputStream and InputStreamReader, and get rid of the "is" and
"reader" variables (and all lines refering to those variables). Instead,
use FileReader. You can also get rid of the declaration for "process".
Also, uncomment the code at the end of the "try" block.

4) exec() launches the command in a separate process but does not wait for
that process to end. Therefore you should use the process's waitFor()
method to make the parent process wait for the child process to finish
before processing continues. Note that waitFor() throws
InterruptedException. Also, make sure to use the "/c" option after "cmd".

   import java.io.FileReader;
   ...

   try {
      ...
      String command = "cmd /c dsmadmc -id=raibeck -password=bab5com
select * from sessions > murali";
      Runtime.getRuntime().exec(command).waitFor();
      br = new BufferedReader(new FileReader("murali"));
      System.out.println("br = " + br);
      String line;
      while ((line = br.readLine())!=null) {
         System.out.println("line:"+line);
      }
   }
   catch(InterruptedException intex)
   {
      System.out.println(intex.getMessage());
   }
   ...

5) You may find it desirable to add the -commadelimited or -tabdelimited
option to dsmadmc, which will help in parsing the resulting output. See
the TSM Administrator's Reference, Chapter 3, for more information about
the command line interface.

Regards,

Andy

Andy Raibeck
IBM Software Group
Tivoli Storage Manager Client Development
Internal Notes e-mail: Andrew Raibeck/Tucson/IBM@IBMUS
Internet e-mail: storman AT us.eyebm DOT com (change eye to i to reply)

The only dumb question is the one that goes unasked.
The command line is your friend.
"Good enough" is the enemy of excellence.




murali ramaswamy <muralirama29 AT HOTMAIL DOT COM>
Sent by: "ADSM: Dist Stor Manager" <ADSM-L AT VM.MARIST DOT EDU>
11/01/2002 09:14
Please respond to "ADSM: Dist Stor Manager"


        To:     ADSM-L AT VM.MARIST DOT EDU
        cc:
        Subject:        Re: HELP ON wzrdhlpr.exe command lIn TSM (Tivoli
storage manager) 5.1?



Hi,
  When I execute the command on MSDOS prompt it writes the output to the
file murali but when I do the same through java code as shown at end it
does
not write and it does not give any erros either.  Any thoughts?  (I tried
to
capture the console output without redirecting to a file first.  But that
hangs as on console it shows number of pages and for each page waits for
user input of pressing Enter key or C key.)
Thanks
Code is below:

D:\Program Files\tivoli\tsm\console>wzrdhlpr -id=admin -password=admin
-tab
select * from sessions > murali


import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.io.BufferedReader;
import java.io.IOException;
import java.sql.*;

public class TSM extends TSMConnect
{
  public static void main(String args[])
{
   if (args.length != 0)
  {
    System.out.println("Usage: java TSM");
    System.exit(1);
  }
  String query = "SELECT * FROM columns";
  TSM tsmObj = new TSM();
  Connection dbc = null;
  Statement stmt = null;
  ResultSet resultSet = null;
  Process process = null;
  InputStream is = null;
  Reader reader = null;
  BufferedReader br = null;
  try
{

    dbc = tsmObj.connect();
    stmt = dbc.createStatement();
    resultSet = stmt.executeQuery(query);
    tsmObj.presentResultSet(resultSet);
    Runtime.getRuntime().exec("cmd d:");
    Runtime.getRuntime().exec("cmd /c cd D:\\Program
Files\\tivoli\\tsm\\console\\");
    String command = "cmd wzrdhlpr -id=admin -password=admin select * from
sessions > murali";
    //process =
    Runtime.getRuntime().exec(command);
    /*is = process.getInputStream();
    reader = new InputStreamReader(is);
    br = new BufferedReader(reader);
    String line;
    while ((line = br.readLine())!=null) {
      System.out.println("line:"+line);
    }*/
}
catch(IOException ioex)
{
   System.out.println(ioex.getMessage());
}
catch (SQLException sqlex)
{
    System.out.println(sqlex.getMessage());
  }
finally
{
  tsmObj.close(dbc, stmt);
}
}
public void presentResultSet(ResultSet rs) throws SQLException
{
  if (!rs.next()) System.out.println("No records to display");
  else
  {
    do
    {
      //System.out.println(rs.getString("TABNAME") + ": " +
rs.getString("COLNAME") + ": "
+rs.getInt("COLNO")+":"+rs.getString("TYPENAME") + ": "
+rs.getString("REMARKS"));
     } while (rs.next());
  }
}
}


_________________________________________________________________
Internet access plans that fit your lifestyle -- join MSN.
http://resourcecenter.msn.com/access/plans/default.asp

<Prev in Thread] Current Thread [Next in Thread>