Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

DBD::TSM says Invalid user id or password

by FloydATC (Chaplain)
on Feb 03, 2011 at 13:29 UTC ( #885988=perlquestion: print w/replies, xml ) Need Help??
FloydATC has asked for the wisdom of the Perl Monks concerning the following question:

Esteemed monks, I'm trying to get DBD::TSM to work, but it refuses to accept my administrative username and password. Using Perl v5.8.8 on CentOS 5.4, have installed TIVsm-API-6.1.0-2 and TIVsm-BA-6.1.0-2. My test script is a slight rewrite of the example script ("dbi" was spelled "DBB" and no environment variables were set).
#!/usr/bin/perl -w use DBI; my ($server_name,$user,$password)=("enigsy-ser-backup-01", "########", + "########"); $ENV{'DSM_DIR'} = "/opt/tivoli/tsm/client/ba/bin/"; $ENV{'DSMADMC'} = "dsmadmc"; $ENV{'DSM_CONFIG'} = $ENV{'DSM_DIR'}."dsm.sys"; my $dbh=DBI->connect( "dbi:TSM:$server_name", $user, $password, { RaiseError => 0, PrintError => 0 } ) or die $DBI::errstr; my $sth=$dbh->prepare("query status") or die $dbh->errstr; $sth->execute() or die $sth->errstr(); print "@{$sth->{NAME}}\n"; $sth->dump_results();

The result? Connect: Invalid user id or password '########/########': 255/. at ./testq line 12.

The manual test suggested in the docs works ok, which should confirm that the dsmcadm and the login/password is OK:

[root@ikt-anlu-c5 bin]# dsmadmc -id=######## -pa=######## -se=enigsy-s +er-backup-01 query status IBM Tivoli Storage Manager Command Line Administrative Interface - Version 6, Release 1, Level 0. +2 (c) Copyright by IBM Corporation and other(s) 1990, 2009. All Rights R +eserved. Session established with server ENIGSY-SER-BACKUP-01: Windows Server Version 6, Release 1, Level 3.0 Server date/time: 02/03/2011 14:01:04 Last access: 02/03/2011 13:58 +:20 ANS8000I Server command: 'query status' Storage Management Server for Windows - Version 6, Release 1, Level 3. +0 Server Name: ENIGSY-SER-BACKUP-01 [...]

And here's dsm.sys:

SErvername enigsy-ser-backup-01 COMMMethod TCPip TCPPort 1500 TCPServeraddress passwordaccess generate errorlogretention 14 d * 14 dager, d = delete errorlogname /var/log/dsm.errorlog schedlogretention 14 d schedlogname /var/log/dsm.schedlog managedservices webclient schedule *** Include/exclude Exclude /tmp Exclude /proc Exclude /.../core Exclude.Dir /mnt

I'm looking for someone who has worked with this module before and perhaps knows where to start looking for the cause?

Update: moritz suggested I use tcpdump to inspect the network traffic. DBD::TSM generates none at all.

-- Time flies when you don't know what you're doing

Replies are listed 'Best First'.
Re: DBD::TSM says Invalid user id or password
by Khen1950fx (Canon) on Feb 04, 2011 at 09:48 UTC
    This isn't really an answer but maybe a start. I spent some time debugging it. I couldn't replicate your error; however, I did have a problem with getting $sth->dump_results(); to work---it wouldn't work for me. Another other problem was that I had to set the env var for my dbi_driver. Maybe this will help.
    #!/usr/bin/perl use strict; use warnings; use DBI; use DBD::TSM; $ENV{'DBI_DRIVER'} = "DBM"; $ENV{'DSM_DIR'} = "/opt/tivoli/tsm/client/ba/bin/"; $ENV{'DSMADMC'} = "dsmadmc"; $ENV{'DSM_CONFIG'} = $ENV{'DSM_DIR'} . "dsm.sys"; my @drivers = DBI->available_drivers; print join( ",", @drivers ), "\n"; eval { my ( $server_name, $user, $password ) = ( "enigsy-ser-backup-01", "user", "password" ); }; my $dbh = DBI->connect( "DBD:TSM:enigsy-ser-backup-01", 'user', 'password', { RaiseError => 0, PrintError => 0 } ) or die $DBI::errstr; my $sth = $dbh->prepare("INSERT INTO foo VALUES (1, 2, 3)"); $sth->execute() or die $sth->errstr(); print @{ $sth->{NAME} }, "\n"; $dbh->disconnect or warn $dbh->errstr;

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://885988]
Approved by marto
Front-paged by Corion
[LanX]: memories....I missed my connection while chatting
[Discipulus]: in this case Corion we are speaking about software licensing: evry year or two we must rescan the whole ced to produce an excel report, while at every activation / disactivation we update a black box DB: i said that i a week i can produce the perl to..
[Discipulus]: rend out the xls IF i have access to the DB
[choroba]: LanX I miss working in a bank sometimes...
[Corion]: Discipulus: Ooof. Especially yearly things are things I like to automate instead of trying to remember how I did things last year...
[Corion]: And the second rule that I've learned is, that there is no one-off job, so writing a program for it pays off almost immediately. The third rule is to give all my programs numbers and have them reproduce that number in the name of their output files. :)
[Discipulus]: the true part is that also specification change between years.. but well our job is cheap but dont abuse of us.. ;=)
[LanX]: Choroba: do you miss chaos with ties? apply at the US government.. ;)

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (12)
As of 2017-03-29 12:10 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (350 votes). Check out past polls.