By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,710 Members | 1,887 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,710 IT Pros & Developers. It's quick & easy.

Pearl: how would I send router command output to a varaible and a file

P: 2
Folks,

I'm trying to execute a command on a router and then storing that output to a variable e.g. $output..I don't know how to do it in Pearl..Any help would be appreciated in this regard.

Thanks
-Babar
Aug 3 '10 #1
Share this Question
Share on Google+
4 Replies


Expert 100+
P: 785
$output=$router->execute($ACommand);
Aug 3 '10 #2

Oralloy
Expert 100+
P: 983
Babar,

How is the script supposed to connect to the router? Serial port? Telnet? HTTP?

Please give us some real information, if you want help.

Cheers
Aug 3 '10 #3

P: 2
Thanks for the pointer....I've connected to router via telnet....This is what I used to do in TCL, but don't know how would we do in Perl..

set output [$router exec "sh run | inc trap"]

Thanks
Babar
Aug 4 '10 #4

Oralloy
Expert 100+
P: 983
I'd recommend the Net::Telnet.pm module. You can find it on CPAN here.

Hopefully that gets you off the ground.
Aug 4 '10 #5

Post your reply

Sign in to post your reply or Sign up for a free account.