Hey!!!!I'm looking for the perl to java conversion!!!!
Can Someone please help me with the snippet!!!!
As soon as possible!!
Its very important!!!!
my @hosts = get_hosts_ips_bymkt();
for(my $i = 0; $i < scalar(@hosts); $i = $i + 1){
my $ssh_true = eval {
Net::SSH::Perl->new($hosts[$i])
};
// # $success = $ssh;
// # print "ssh=".$sucess;
if($ssh_true){
$Lsmr_IP = $hosts[$i];
print "Lsmr_IP=".$Lsmr_IP."\n";
last;
}else{
$Lsmr_IP = $hosts[$i];
print "Ip ".$Lsmr_IP." Is not connecting; trying next";
}
}
print "Lsmr_IP=".$Lsmr_IP."\n";
}
my $ssh_lsm = new Control::CLI(Use => 'SSH',
Prompt => ']',
Errmode=> 'return',
Timeout=> '30',
Dump_log => "ts.dump.log");
my $Lsmr_Connect = $ssh_lsm->connect(Host => $Lsmr_IP,
Username => $user,
Password => $pass,
PrivateKey => '.ssh/id_dsa');
print "user=".$user."\n";
print "pswd".$pass."\n";
if ($Lsmr_Connect) { #start if connected
print "st3"."\n";
if (!$checkIVR){###jumpbox
$ssh_lsm->waitfor('\>');
$ssh_lsm->print("001");
//# $ssh_lsm->print("002");