Friday, September 12, 2008

Installing IBM Tape System Reporter

On Sept. 8th I got an email from IBM notifying me that Tape System Reporter had been released, it is supposed to:
The IBM Tape System Reporter (TSR) application enables operators and administrators of the TS3500 Tape Library to monitor and report on storage devices in an enterprise environment
I have two TS3500 with 12 drives between them so this sounded pretty good, I thought I would install it and see what it can offer. I am a big fan of reporting since usually I can gain some ground with management to buy more stuff if I have pretty graphs in my hands!

Unfortunately I was in for a ride on this, I should have known when I read this:
It is not the intent of this documentation to explain how to download and use
Derby to establish a database that contains the authorizations for using the IBM
Tape System Reporter application.
Which means that I had to learn how to install a new application (apache Derby) with little help from IBM... I was able to accomplish this - though at the end I had not read the requirements well enough and found that I did NOT have ALMS licensed so even though I had the app installed correctly I couldn't get the data out of it... Either way here are the steps I went through to install this app.

You need Windows XP or 2000 for the install so I booted up a XP virtual machine using Virtual Box.

  1. Download and install the latest version of java from http://www.java.com, derby is a java database...
  2. Install Adobe Reader from http://www.adobe.com/products/acrobat/readstep2.html, the install docs are in PDF and copy/paste from my main OS to the virtual box doesnt always work...
  3. Download the latest version of derby from http://db.apache.org/derby/derby_downloads.html
  4. Extract derby, I chose to go with c:\derby_10\ like the doc shows, earlier I had tried putting it in c:\program files\derby\ but didn't have much luck - I started to wonder if the %PATH% variables where getting stuck on the spaces in the directory structure.
  5. Time to set some variables, you can set these on the command line for one time use or set them in the global profile, I chose the later:
    1. Right click on "My Computer", click on properties
    2. select the 'Advanced' tab, click on Environment variables
    3. on the lower half of the window that opens (System Variables) click 'New'
    4. Variable name = DERBY_HOME, Variable value = C:\Derby_10 (or the directory you expanded the derby zip into). Click OK
    5. Click on 'Path' in the System Variables section, choose 'Edit'
    6. To the end of the Variable value add the following: ;%DERBY_HOME%\bin
  6. Good time to validate those variables, open a command prompt (Start->Run->cmd) and type the following:
    1. echo %DERBY_HOME%
      • output should be the variable value you set in step 5, in my case c:\derby_10
    2. ij
      • this command is part of the derby package, output should look something like:
        version 10.4

        ij>
      • if that is working simply type 'quit;' to exit the ij shell, if you dont see the ij prompt your system variables are not set correctly!
  7. At this point the directions from IBM start to lose their usefulness, some of the files they mention don't exist, other required files are not mentioned... good thing they had that disclaimer at the beginning of the document!
  8. Navigate to %DERBY_HOME\bin and copy the derby_common, startNetworkServer and stopNetworkServer scripts to the main derby folder (one folder down). The instructions mention a derby.properties file, i believe this would only exist if you had previously used derby so if it doesn't exist you can create it in the next step
  9. create a new file and save it as derby.properties in %DERBY_HOME%, remember that if you create the file with notepad (as I did) that you must set the "Save as type:" to "All Files" or windows will magically append .txt to the filename.
  10. Add the following to your %DERBY_HOME%/derby.properties file, in this example I am using tsruser as the username and tsrpass as the password - adjust accordingly.
    derby.connection.require Authentication=true

    derby.authentication.provider=BUILTIN

    derby.user.tsruser=tsrpass

    derby.databasedefaultConnectionMode=fullAccess
  11. Now you need to edit the startNetworkServer script in %DERBY_HOME%, if you have your CLASSPATH setup for derby you can follow the IBM instructions, I did not so I had a much longer string to enter. Note that in my example I am setting the directory for the database to be created in as %DERBY_HOM%\tsrdb. Add the following to the end of the script (should be one long line):
    java -classpath %DERBY_HOME%\lib\derby.jar;%DERBY_HOME%\lib\derbynet.jar;%DERBY_HOME%\lib\derbyclient.jar;%DERBY_HOME%\lib\derbytools.jar;%DERBY_HOME%\lib\derbyrun.jar -Dderby.system.home=%DERBY_HOME%\tsrdb\ org.apache.derby.drda.NetworkServerControl start -h localhost -p 1527
  12. Add a vary similar line to %DERBY_HOME%\stopNetworkServer:
    java -classpath %DERBY_HOME%\lib\derby.jar;%DERBY_HOME%\lib\derbynet.jar;%DERBY_HOME%\lib\derbyclient.jar;%DERBY_HOME%\lib\derbytools.jar;%DERBY_HOME%\lib\derbyrun.jar -Dderby.system.home=%DERBY_HOME%\tsrdb\ org.apache.derby.drda.NetworkServerControl shutdown -h localhost -p 1527
  13. You can test the start and stop scripts at this point by double clicking on them, the start script should open a command window that accepts no input and the stop script should open a command window and then close both the start and stop windows. If everything is working correctly go to the next step, otherwise double check everything.
  14. Time to create the database - start the derby server by double clicking on %DERBY_HOME%\startNetworkServer, open a command window and get an ij prompt by typing 'ij'. Enter the following text to create the database - I am using tsrdb as the database name, tsruser as the username and tsrpass as the password
    connect 'jdbc:derby://localhost:1527/tsrdb;create=true;user=tsruser;pass=tsrpass';
  15. Check the %DERBY_HOME% directory, you should see a folder matching your database name (tsrdb in my examples). If you do then you should have the derby portion of the install complete!
  16. Install the DB2 Run-Time Client Lite that is mentioned as a prereq in the docs, you can find it at http://www-01.ibm.com/support/docview.wss?uid=ssg1S4000680. I took the defaults and did a 'Typical' install which worked fine.
  17. Download the TSR zip file, it can be found on the page mentioned in step 16. Extract it to a directory of your choosing, I like c:\Program Files\tsr
  18. Now we can check on the database connectivity and create the table to store data in:
    • Double click on the tsr executable, from the menu choose 'Database->Setup'.
    • Enter your database name (tsrdb) the IP (localhost) and port (1527)
    • Click Test, enter the username (tsruser) and password (tsrpass) and click OK
    • The system will churn for a minute and should say 'Test Passed'.
    • Select the 'Table' tab while still in the Setup window and choose a table name, according to IBM this table will be used for storing the library performance data, I chose 'tsrdata'.
    • Click create, you will need to enter your username and password again (tsruser/tsrpass) and click OK
    • Output should be 'Table created successfully', click OK and then click OK again.
  19. Time to connect to the database and begin collecting data
    • Click 'Database->Connect'
    • enter username and password, click OK, should get 'Connection successful'
    • Click 'File->Start Monitoring'
    • enter the IP address or dns entry of the TS3500 you would like to monitor and click OK
    • A window should open and have some output in it like 'Starting Monitor on Tape Library yourlibnamehere'
    • cant say much more, without ALMS licensed this is as far as I got :( but hopefully it works!
Hopefully this helps someone, if I get an ALMS license soon I would like to post some screenshots of the app actually displaying useful data. Maybe someone can send me some!