Aug 21, 2012, 7:50 AM
Post #1 of 11
Hi i have one server from where i login to all my network devices to execute command. I need to execute some commands on daily basis on all network device (show processes cpu history and show log) , after loggin in to the terminal server and from their accessing individual network devices.
extended login using perl script
i wrote the script to access the terminal server and it is successful but how to login to all the network devices from there and execute the command i have no clue. i am newbie in the scripting field and hence any suggestion is highly appreciate.
following is the .pl for login in to terminal server
@servers = ("EGHQ-PR-1","EGHQ-PR-2","PR-1","PR-2");
my $host = "taco";
my $user = "s******";
my $password = "s****";
my $ssh = Net::SSH2->new();
my $channel = $ssh->channel();
my $command = $channel->exec("nslookup taco") or die $_;
my $len = $channel->read($output,2048);
print "output is $output\n";
it works fine.
please assist how to proceed from here.
(This post was edited by parvees on Aug 21, 2012, 9:15 AM)