In junipercmd you have:
So it won't match, thus won't return command to your program. Try a simple ERXO2. You really only need to set this once. ***You probably don't even need to set it at all as there is an inbuilt default that should work***.Prompt => '/ERX02>$/' But in your example the prompt returned is ERX02#
As an aside you are obviously not using strict and passing things around as globals - this is bad. The logic for having subs that simply serve as more or less useless wrappers around the existing functions in Net::Telnet::Cisco eludes me. In your prompt RE you have @[ which will not be doing what you think it does, whatever that might be.
Does this work:
#!/usr/bin/perl use Net::Telnet::Cisco; use strict; my $rtrip = 'xx.xx.xx.xxx'; my $user = 'login'; my $pass = 'support123'; my $cmd = 'some command'; my $session = Net::Telnet::Cisco->new( Host => $rtrip, Prompt => '/ERX02/, Timeout => '30'); $session->login( Name => $login, Password => $pass, ); my @output = $session->cmd($cmd); print @output;
In reply to Re: help needed
by tachyon-II
in thread help needed
by Mejaz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |