use Net::SSH::Any; use Config::IniFiles; # Check for valid number of arguments if (!defined $ARGV[0] && !defined $ARGV[1]) { die("Usage: export_ddts.pl projectname tmpl_path \n"); }; my $project = $ARGV[0]; my $tmpl = $ARGV[1]; ) #command to fetch records under particular class or project my $cmd="findbug -k $project |dumpbug -fnt $tmpl"; #Connecting to Config Files my $cfg = Config::IniFiles->new( -file => "configfile.ini" ); #fetching Remote connection credentials from .ini file my $ssh_url =$cfg->val( 'REMOTE_CREDENTIALS', 'HOST' ); my $ssh_user =$cfg->val( 'REMOTE_CREDENTIALS', 'USERNAME' ); my $ssh_pwd =$cfg->val( 'REMOTE_CREDENTIALS', 'PASSWORD' ); #Connecting to server and Fetching details my $ssh = Net::SSH::Any->new($ssh_url, user => $ssh_user, password => $ssh_pwd); print "Connecting to Server........."; print "$cmd"; $ssh->system($cmd); #end of File