HP StorageWorks Replication Solutions Manager Command Line User Interface Reference (T3687-96029, August 2005)

B User-written client
You can cr eate a user-written client to access the CLUI. If you create a client, it must provide user
authentication and issue valid comm ands. You can use Perl, Java, or other programming languages
to create a client. You can use the standard telnet conguredport(9000bydefault)toconnectwitha
standard socket connection, using the login command as the initial command. The SSL is accessed via
an a nonymous SSL socket using the same login method.
Sample telnet client using Perl
use strict;
use Net::Telnet (
);
my ($hostname, $l
ine, $passwd, $pop, $username,
$cmd, $res, $teln
et, $port, $prompt, $ mode);
if(@ARGV < 5){
usage();
die "\nincorrect
number of arguments\n\n";
}
($cmd) = @ARGV[4]
;
$hostname = $ARGV
[0];
$port = $ARGV[1];
$username = $ARGV
[2];
$passwd = $ARGV[3
];
$mode = 1;
$telnet = new Net:
:Telnet (Telnetmode => 1,
Timeout => 600,
Cmd_remove_mode
=> $mode,
Prompt => '/[>] $/'
);
$telnet->open(Ho
st => $hostname,
Port => $port);
## Read connectio
n message.
$line = stripLine(
);
## Send user name.
$telnet->print("
$username");
## Send password.
$telnet->print("
$passwd");
#read the response
s up to this point (ignoring)
readResponse();
#Send the command p
assed in as an arg
$telnet->print("
$cmd");
#remove the comman
d echo
stripLine();
#get and show the re
sponse
$res=readRespons
e();
print("$res\n");
exit;
HP StorageWorks Replication Solutions Manager Command Line User Interface reference
45